You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
511 B
JavaScript
24 lines
511 B
JavaScript
import express from 'express'
|
|
|
|
// import serveStatic from 'serve-static'
|
|
import bodyParser from 'body-parser'
|
|
|
|
import { loggingMiddleware, PingRouter, StatusRouter } from './server/helpers.js'
|
|
|
|
const app = express()
|
|
|
|
app.use(bodyParser.json())
|
|
app.use(loggingMiddleware)
|
|
|
|
app.use('/api/status', new StatusRouter())
|
|
app.use('/api/ping', new PingRouter())
|
|
|
|
app.all('*', (req, res) => {
|
|
res.status(404)
|
|
res.end('Not found')
|
|
})
|
|
|
|
app.listen(4000, () => {
|
|
console.log(`Started server on port 4000...`)
|
|
})
|