Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created May 26, 2021 18:34
Show Gist options
  • Save sergueyarellano/cc69afce80c5c9388ba9f794e9113eb6 to your computer and use it in GitHub Desktop.
Save sergueyarellano/cc69afce80c5c9388ba9f794e9113eb6 to your computer and use it in GitHub Desktop.
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const port = process.env.PORT || 3010
app.use(bodyParser.json())
app.get('/data', (req, res) => {
const data = [
{
type: 'store',
class: 'dog',
report: 'Nice dog store in downtown Toronto',
address: '203 King street West',
range: 100
},
{
type: 'store',
class: 'cat',
report: 'Nice cat store in downtown Toronto',
address: '200 Wellington street West',
range: 50
},
{
type: 'store',
class: 'dog',
report: 'Nice alternative dog store in downtown Toronto',
address: '203 King street West',
range: 220
},
{
type: 'store',
class: 'barber shop',
report: 'Nice barber shop downtown Toronto',
address: '20 King street West',
range: 10
}
]
res.json(data)
})
app.listen(port, () => console.log(`stub magic happens on port ${port}`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment