You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
506 B

const fastify = require('fastify')({
logger: true
})
// adding files and plugins
fastify
.register(require('./plugins/lowdb.js'))
.register(require('./api/note.js'), { 'prefix': '/api' })
.register(require('./static/index.js'))
// let it rain
const start = async () => {
try {
await fastify.listen(3000)
fastify.log.info(`server listening on ${fastify.server.address().port}`)
} catch (err) {
fastify.log.error(err)
process.exit(1)
}
}
start()