Code files
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
'use strict'
|
||||
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
pretendDbQuery(() => {
|
||||
var msg = req.query.msg
|
||||
|
||||
if (Array.isArray(msg)) msg = msg.pop()
|
||||
|
||||
const yelling = (msg || '').toUpperCase()
|
||||
res.send(yelling)
|
||||
})
|
||||
})
|
||||
|
||||
app.listen(3000)
|
||||
|
||||
function pretendDbQuery (cb) {
|
||||
setTimeout(cb, 0)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
'use strict'
|
||||
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
pretendDbQuery(() => {
|
||||
const yelling = (req.query.msg || '').toUpperCase()
|
||||
res.send(yelling)
|
||||
})
|
||||
})
|
||||
|
||||
app.listen(3000)
|
||||
|
||||
function pretendDbQuery (cb) {
|
||||
setTimeout(cb, 0)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "app",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.15.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user