import fastify from 'fastify' import dotenv from 'dotenv' import path from 'path' // getting .env dotenv.config({ path: path.join(path.resolve(), '/../../.env') }) // create server const server = fastify() /** * add plugins * */ import { Liquid } from 'liquidjs' import pov from 'point-of-view' const engine = new Liquid({ root: path.join(path.resolve(), '../frontend/views'), extname: '.liquid', }) server.register(pov, { engine: { liquid: engine } }) /** * add routes * */ import taskHttp from './http/api/task.js' import handlerHttp from './http/api/handler.js' import indexHttp from './http/index.js' import staticHttp from './http/static.js' server .register(taskHttp, { 'prefix': '/api/v1' }) .register(handlerHttp, { 'prefix': '/api/v1' }) .register(indexHttp) .register(staticHttp) export default server