var stormpath = require('express-stormpath');
var morgan = require('morgan');
var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require('./webpack.config');

var app = express();
var compiler = webpack(config);

app.use(morgan('combined'));

app.use(require('webpack-dev-middleware')(compiler, {
  noInfo: true,
  publicPath: config.output.publicPath
}));

app.get('/css/bootstrap.min.css', function (req, res) {
  res.sendFile(path.join(__dirname, 'build/css/bootstrap.min.css'));
});

app.use(stormpath.init(app, {
  web: {
    produces: ['application/json']
  }
}));

app.get('*', function (req, res) {
  res.sendFile(path.join(__dirname, 'build/index.html'));
});

app.on('stormpath.ready', function () {
  console.log('Stormpath Ready');
    
  app.listen(3000, 'localhost', function (err) {
    if (err) {
      console.log(err);
      return;
    }

    console.log('Listening at http://localhost:3000');
  });
});
@@ -619,24 +619,1002 @@
 %5D%0A  %7D%0A%7D));%0A%0A
+app.post('/me', bodyParser.json(), stormpath.loginRequired, function (req, res) %7B%0A  function writeError(message) %7B%0A    res.status(400);%0A    res.json(%7B message: message, status: 400 %7D);%0A    res.end();%0A  %7D%0A  %0A  function saveAccount () %7B%0A    req.user.givenName = req.body.givenName;%0A    req.user.surname = req.body.surname;%0A    req.user.email = req.body.email;%0A    %0A    req.user.save(function (err) %7B%0A      if (err) %7B%0A        return writeError(err.userMessage %7C%7C err.message);%0A      %7D%0A      res.end();%0A    %7D);%0A  %7D%0A%0A  if (req.body.password) %7B%0A    var application = req.app.get('stormpathApplication');%0A    %0A    application.authenticateAccount(%7B%0A      username: req.user.username,%0A      password: req.body.existingPassword%0A    %7D, function (err) %7B%0A      if (err) %7B%0A        return writeError('The existing password that you entered was incorrect.');%0A      %7D%0A      %0A      req.user.password = req.body.password;%0A      %0A      saveAccount();%0A    %7D);%0A  %7D else %7B%0A    saveAccount();%0A  %7D%0A%7D);%0A%0A
 app.get('*',
@@ -1947,12 +1947,13 @@
 );%0A  %7D);%0A%7D);
+%0A

add missing /me route in server.js