mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 12:43:12 +03:00
добавлен пример роута
This commit is contained in:
parent
46c96bc2e9
commit
6e2b9d6ab3
1 changed files with 29 additions and 0 deletions
29
main.js
Normal file
29
main.js
Normal 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)
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue