Node.js VScode中的REST客户端代理问题
在VSCode中使用REST客户端扩展时,例如Node.js VScode中的REST客户端代理问题,node.js,visual-studio-code,proxy,Node.js,Visual Studio Code,Proxy,在VSCode中使用REST客户端扩展时,例如 Send Request GET http://localhost:4200/dashboard ### 我发现以下错误: Connection is being rejected. The service isn’t running on the server, or incorrect proxy settings in vscode, or a firewall is blocking requests. Details: Request
Send Request
GET http://localhost:4200/dashboard
###
我发现以下错误:
Connection is being rejected. The service isn’t running on the server,
or incorrect proxy settings in vscode, or a firewall is blocking requests.
Details: RequestError: connect ECONNREFUSED 127.0.0.1:4200
如何将http代理更改为4200而不是127.0.0.1:4200?对我有效的解决方案是使用字符串更改服务器主机名(主机名:“127.0.0.1”) Deno/TS/Rest客户端扩展vscode 应用程序ts api.ts 请求http 或
对我来说,解决方案是用字符串(hostname:“127.0.0.1”)更改服务器主机名 Deno/TS/Rest客户端扩展vscode 应用程序ts api.ts 请求http 或
import { Drash } from "https://deno.land/x/drash@v1.4.3/mod.ts";
import { Api } from "./api.ts";
const server = new Drash.Http.Server({
response_output: "application/json",
resources: [Api],
});
server.run({
hostname: "127.0.0.1", // Just here !
port: 1854,
});
console.log("Server running...");
// @ts-ignore
import { Drash } from "https://deno.land/x/drash@v1.4.3/mod.ts";
export class Api extends Drash.Http.Resource {
static paths = ["/"];
public GET() {
this.response.body = `Hello World! (on ${new Date()})`;
return this.response;
}
}
GET http://localhost:1854/ HTTP/1.1
GET http://127.0.0.1:1854/ HTTP/1.1