Skip to content

Instantly share code, notes, and snippets.

@jezinka

jezinka/app.js Secret

Created December 17, 2017 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jezinka/07efeb4587ffd00a3d708a6e9e707cad to your computer and use it in GitHub Desktop.
Save jezinka/07efeb4587ffd00a3d708a6e9e707cad to your computer and use it in GitHub Desktop.
const express = require('express')
const helmet = require('helmet')
const app = express()
app.use(helmet())
app.get('/', function (req, res) {
const start_point = req.query.from
if (start_point === 'home') {
res.json({ from: start_point, leave: '14:33', departure: '14:41', arrival: '14:47', on_the_spot: '14:57', bus: 'D' })
} else if (start_point === 'work') {
res.json({ from: start_point, leave: '14:17', departure: '14:20', arrival: '14:55', on_the_spot: '14:57', bus: ['33', '331'], transfer: 'Bujwida' })
} else {
res.status(400).json({ message: 'Gdzieś ty poszedł???!!!' })
}
})
app.listen(8080, () => console.log('Odjazd!'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment