fp/services/htmx/index.ts

21 lines
409 B
TypeScript
Raw Normal View History

2024-12-12 07:23:46 +00:00
import { configs } from './config.ts'
import Fastify from 'fastify'
const fastify = Fastify({
logger: true
})
// Declare a route
fastify.get('/', function (request, reply) {
reply.send({ hello: 'world' })
})
// Run the server!
fastify.listen({ port: configs.port }, function (err, address) {
if (err) {
fastify.log.error(err)
process.exit(1)
}
// Server is now listening on ${address}
})