Showing
2 changed files
with
5 additions
and
3 deletions
... | @@ -4,7 +4,7 @@ var favicon = require('serve-favicon'); | ... | @@ -4,7 +4,7 @@ var favicon = require('serve-favicon'); |
4 | var logger = require('morgan'); | 4 | var logger = require('morgan'); |
5 | var cookieParser = require('cookie-parser'); | 5 | var cookieParser = require('cookie-parser'); |
6 | var bodyParser = require('body-parser'); | 6 | var bodyParser = require('body-parser'); |
7 | - | 7 | +var cors = require('cors'); |
8 | var routes = require('./routes/index'); | 8 | var routes = require('./routes/index'); |
9 | var users = require('./routes/users'); | 9 | var users = require('./routes/users'); |
10 | 10 | ||
... | @@ -17,6 +17,7 @@ app.set('view engine', 'jade'); | ... | @@ -17,6 +17,7 @@ app.set('view engine', 'jade'); |
17 | // uncomment after placing your favicon in /public | 17 | // uncomment after placing your favicon in /public |
18 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); | 18 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); |
19 | app.use(logger('dev')); | 19 | app.use(logger('dev')); |
20 | +app.use(cors()); | ||
20 | app.use(bodyParser.json()); | 21 | app.use(bodyParser.json()); |
21 | app.use(bodyParser.urlencoded({ extended: false })); | 22 | app.use(bodyParser.urlencoded({ extended: false })); |
22 | app.use(cookieParser()); | 23 | app.use(cookieParser()); |
... | @@ -56,8 +57,8 @@ app.use(function(err, req, res, next) { | ... | @@ -56,8 +57,8 @@ app.use(function(err, req, res, next) { |
56 | }); | 57 | }); |
57 | }); | 58 | }); |
58 | 59 | ||
59 | -app.listen(process.env.PORT||3000, function(){ | 60 | +app.listen(process.env.PORT||4000, function(){ |
60 | - console.log ("Server is running at 3000"); | 61 | + console.log ("Server is running at 4000"); |
61 | }); | 62 | }); |
62 | 63 | ||
63 | module.exports = app; | 64 | module.exports = app; | ... | ... |
... | @@ -9,6 +9,7 @@ | ... | @@ -9,6 +9,7 @@ |
9 | "async": "^2.1.2", | 9 | "async": "^2.1.2", |
10 | "body-parser": "~1.15.1", | 10 | "body-parser": "~1.15.1", |
11 | "cookie-parser": "~1.4.3", | 11 | "cookie-parser": "~1.4.3", |
12 | + "cors": "^2.8.1", | ||
12 | "debug": "~2.2.0", | 13 | "debug": "~2.2.0", |
13 | "express": "~4.13.4", | 14 | "express": "~4.13.4", |
14 | "jade": "~1.11.0", | 15 | "jade": "~1.11.0", | ... | ... |
-
Please register or login to post a comment