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,33 @@
'use strict'
const express = require('express')
const escapeHtml = require('escape-html')
const app = express()
app.get('/', (req, res) => {
const {prev = '', handoverToken = '', lang = 'en'} = req.query
pretendDbQuery((err, status) => {
if (err) {
res.sendStatus(500)
return
}
const href = escapeHtml(`/${prev}${handoverToken}/${lang}`)
res.send(`
<h1>Current Status</h1>
<div id=stat>
${escapeHtml(status)}
</div>
<br>
<a href="${href}"> Back to Control HQ </a>
`)
})
})
function pretendDbQuery (cb) {
const status = 'ON FIRE!!! HELP!!!'
cb(null, status)
}
app.listen(3000)
@@ -0,0 +1,16 @@
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"escape-html": "^1.0.3",
"express": "^4.15.2"
}
}