Code files

This commit is contained in:
Akhil
2017-07-31 11:33:31 +05:30
parent 073a63ebdd
commit b9ae409ec0
801 changed files with 17535 additions and 0 deletions
@@ -0,0 +1,15 @@
{
"name": "adderservice",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Peter Elger",
"license": "ISC",
"dependencies": {
"restify": "^4.3.0"
}
}
@@ -0,0 +1,19 @@
'use strict'
const restify = require('restify')
function respond (req, res, next) {
const result = (parseInt(req.params.first, 10) +
parseInt(req.params.second, 10)).toString()
console.log('adding numbers!')
res.send(result)
next()
}
const server = restify.createServer()
server.get('/add/:first/:second', respond)
server.listen(8080, () => {
console.log('%s listening at %s', server.name, server.url)
})