добавлен пример роута

This commit is contained in:
Данил 2024-02-14 15:11:24 +03:00
parent 46c96bc2e9
commit 6e2b9d6ab3

29
main.js Normal file
View file

@ -0,0 +1,29 @@
const fastify = require('fastify')({ logger: true });
fastify.route({
method: 'GET',
url: '/',
schema: {
querystring: {
},
response: {
200: {
}
}
},
preHandler: async (res, reply) => {
},
handler: async (res, reply) => {
}
})
try {
await fastify.listen({ port: 3000 })
} catch (err) {
fastify.log.error(err)
process.exit(1)
}