javascript - node.js problems with app.get() function -


i'm trying create site uses mongojs. i'm trying use code below, once run site, never gets app.get() parts, , site ends showing 500 error. how can make respond app.get function?

thanks help!

var express = require('express');  var cookieparser = require('cookie-parser');  var session = require('express-session');    require('node-monkey').start({host: "127.0.0.1", port:"50500"}); //todo: delete    var app = express();  var mongojs = require('mongojs');  var db = mongojs('mongodb://localhost:27017/test', ['usersdata']);  var usersdata = db.collection('usersdata');    app.use(express.static(__dirname + '/views'));  app.use(cookieparser());  app.use(session({      secret: 'keys',      resave: true,      saveuninitialized: true  }));  app.get('/', function (req, res) {      console.log("here");  });

you have start listen. add line below :

  app.listen(port); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -