clatter/server/index.ts

18 lines
323 B
TypeScript
Raw Normal View History

2024-08-09 20:29:24 +02:00
import autoload from '@fastify/autoload'
import Fastify from 'fastify'
import path from 'path'
const server = Fastify({
logger: true
})
server.register(autoload, {
dir: path.join(__dirname, 'routes')
})
try {
await server.listen({ port: 3000 })
} catch (err) {
server.log.error(err)
process.exit(1)
}