fastify + qwik
This commit is contained in:
commit
f275c9bc5e
1 changed files with 18 additions and 0 deletions
18
server/index.ts
Normal file
18
server/index.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
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)
|
||||||
|
}
|
Loading…
Reference in a new issue