节点js表示js代理

时间:2017-07-10 18:00:45

标签: javascript angularjs node.js express

Here is an image of the error.我在AngularJS上开发了一个应用程序,当我使用公共wifi运行节点服务器时,我的应用程序运行正常。但是,当我在org network / company wifi上运行它时,我的应用程序无效。有什么帮助吗?

server.js代码

var express = require("express");
var open = require("open");
var bodyParser = require("body-parser");
var cookieParser = require("cookie-parser");
var fs = require("fs");
var path = require("path");
var auth = require("./api/auth");
//var users = require("./api/users");
var transactions = require("./api/transactions");
//var serviceTypes = require("./api/serviceTypes");

var app = express();
app.use(bodyParser.urlencoded({extended: false}))
app.use(bodyParser.json());
app.use(cookieParser());
app.use(express.static("boilerplate"));
app.use(express.static("./"));

app.listen(3000, function () {
console.log("server is running on port:3000");
open("http://localhost:3000/");
});

app.get("/", function (req, res) {
res.sendFile(path.join(__dirname, "boilerplate/index.html"));
});

app.use("/auth", auth);
//app.use("/users", users);
app.use("/transactions", transactions);
//app.use("/servicetypes", serviceTypes);

0 个答案:

没有答案