title: WebStorm: NodeJS Process finished with exit code 0
body: <p>I am new to NodeJS, I have downloaded my project from github and installed all the required NodeJS modules. and know it just showing </p>
  
  <p><strong>Webstorm console:</strong></p>
  
  <blockquote>
    <p>run app.js</p>
  </blockquote>
  
  <pre><code>Process finished with exit code 0
  </code></pre>
  
  <p>and stops the application.</p>
  
  <p>Why it is getting stop. I cannot access <code>localhost:3000</code>. Your guidance will be highly appreciated. </p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var favicon = require('serve-favicon');
  var logger = require('morgan');
  var cookieParser = require('cookie-parser');
  var bodyParser = require('body-parser');
  
  var session = require('express-session');
  var index = require('./routes/index');
  var login = require('./routes/login');
  var logout = require('./routes/logout');
  var contact = require('./routes/contact');
  var signup = require('./routes/signup');
  
  var app = express();
  
  var connection = require('express-myconnection');
  var mysql = require('mysql');
  
  // view engine setup
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'ejs');
  
  app.use(session({
      secret: '123secret',
      proxy: true,
      resave: true,
      saveUninitialized: true
  }));
  
  app.use(
      connection(mysql, {
  
      host: 'localhost',
      user: 'proj',
      password: '123456',
      port: 3306, //port mysql
      database: 'projectnode'
  }, 'request')
  );
  
  // uncomment after placing your favicon in /assets
  //app.use(favicon(path.join(__dirname, 'assets', 'favicon.ico')));
  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({extended: false}));
  app.use(cookieParser());
  app.use(express.static(path.join(__dirname, 'assets')));
  
  app.use('/', index);
  app.use('/login', login);
  app.post('/login', login);
  app.post('/signup', signup);
  app.get('/contact', contact);
  app.post('/contact', contact);
  app.get('/logout', logout);
  
  
  // catch 404 and forward to error handler
  app.use(function (req, res, next) {
      var err = new Error('Not Found');
      err.status = 404;
      next(err);
  });
  
  // error handler
  app.use(function (err, req, res, next) {
      // set locals, only providing error in development
      res.locals.message = err.message;
      res.locals.error = req.app.get('env') === 'development' ? err : {};
  
      // render the error page
      res.status(err.status || 500);
      res.render('error');
  });
  
  module.exports = app;
  </code></pre>