mirror of
https://github.com/cupcakearmy/master-thesis.git
synced 2026-04-02 11:55:30 +00:00
Clear History
This commit is contained in:
20
code/scenarios/one-sat-two-base/base/index.js
Normal file
20
code/scenarios/one-sat-two-base/base/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import Fastify from 'fastify'
|
||||
|
||||
const app = Fastify({ logger: { base: false } })
|
||||
|
||||
app.post('/transmit', async (request) => {
|
||||
request.log.info({ data: request.body })
|
||||
})
|
||||
|
||||
app.get('/time', async () => {
|
||||
return new Date().toISOString()
|
||||
})
|
||||
|
||||
try {
|
||||
process.on('SIGINT', () => app.close())
|
||||
process.on('SIGTERM', () => app.close())
|
||||
await app.listen({ port: 3000, host: '0.0.0.0' })
|
||||
} catch (err) {
|
||||
app.log.error(err)
|
||||
process.exit(1)
|
||||
}
|
||||
Reference in New Issue
Block a user