json-server 0.8.12 and Express 4.x Routing
<p>I have an existing node-express project running on express using express server and have middlewares and routing on express</p>

<pre><code>var express = require('express');
var app = express();
require('/path/to/express_conf_file')(app);
app.listen(config.port);
</code></pre>

<p>I want to use json-server for easy mocking and I've followed <a href="http://nmotw.in/json-server/" rel="nofollow">this</a>. My current code looks like this:</p>

<pre><code>var express = require('express');
var app = require('json-server'); 
var middlewares = express(); 
var server = app.create(); // Returns an Express server 
**var router = server.router('db.json');** // Returns an Express router
server.use(middlewares); 
server.use(router); 
require('./config/express')(middlewares, config); 
server.listen(4000);
</code></pre>

<p>server.route('db.json') seems to be deprecated in Express 4.x. What needs to be done to use 'db.json' with express 4.x?</p>

<p>I am invoking my application and json-server using <code>concurrenrly</code> using <code>npm start</code> and in package.json I've defined:</p>

<pre><code>"js-server": "json-server --watch db.json --port 4000",
"start": "concurrently \"gulp command\" \"npm run js-server\""
</code></pre>

<p>Can somebody please advice as what should be the correct way of using json-server with Express 4.x?</p>