[ABANDONDED] Set of "apps" for the Flexor social network.
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.
 
 
 

31 lines
576 B

import { config } from 'dotenv'
import { resolve } from 'path'
import fastify from 'fastify'
import fastifyStatic from 'fastify-static'
import api from './api'
config()
const server = fastify({
logger: {
level: process.env.LOGGER_LEVEL,
prettyPrint: process.env.LOGGER_PRETTY_PRINT === 'true',
}
})
server.register(api)
server.register(fastifyStatic, {
root: resolve(__dirname, '..', 'apps'),
})
const start = async () => {
try {
await server.listen(process.env.PORT!)
} catch (err) {
process.exit(1)
}
}
start()