1
0
mirror of https://github.com/Microsoft/sql-server-samples.git synced 2025-12-08 14:58:54 +00:00
Files
sql-server-samples/samples/features/json/todo-app/nodejs-express4-rest-api/app.js
Jovan Popovic e5b78ee6c0 Node.js REST APi
Draft version of NodeJS REST API that uses SQL/JSON functions
2016-06-22 13:14:40 +02:00

16 lines
353 B
JavaScript

var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.text());
app.use('/todo', require('./routes/todo'));
// catch 404 and forward to error handler
app.use(function (req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
module.exports = app;