You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
436 B
25 lines
436 B
import { resolve } from 'path'
|
|
import fastify from 'fastify'
|
|
import fastifyStatic from 'fastify-static'
|
|
|
|
const port = 8082
|
|
const server = fastify({
|
|
logger: {
|
|
level: 'info',
|
|
prettyPrint: true,
|
|
}
|
|
})
|
|
|
|
server.register(fastifyStatic, {
|
|
root: resolve(__dirname, '..', 'apps'),
|
|
})
|
|
|
|
const start = async () => {
|
|
try {
|
|
await server.listen(port)
|
|
} catch (err) {
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
start()
|