kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch21/docker-images/todo-api/server.js

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}`);
});