11 lines
301 B
JavaScript
11 lines
301 B
JavaScript
const restify = require("restify");
|
|
const handler = require('./handler');
|
|
|
|
var server = restify.createServer();
|
|
server.use(restify.plugins.bodyParser());
|
|
server.post("/todos", handler.post);
|
|
|
|
server.listen(process.env.PORT, function() {
|
|
console.log(`${server.name} listening at ${server.url}`);
|
|
});
|