import path = require("path") import { Server } from "@proerd/nextpress/lib/server" import { ContextFactory } from "@proerd/nextpress/lib/context" import { websiteContext } from "@proerd/nextpress/lib/context/mappers/website" import { mailgunContext } from "@proerd/nextpress/lib/context/mappers/mailgun" import { knexContext } from "@proerd/nextpress/lib/context/mappers/knex" // ;(async () => { const context = ContextFactory({ projectRoot: path.resolve(__dirname, ".."), mappers: [ websiteContext, mailgunContext, knexContext ], }) await context.database.init({ currentVersion: 1, async migration() {}, }) const server = new Server(context) server.run() })() process.on("unhandledRejection", (...arg: any[]) => { console.error("unhandledRejection", ...arg) process.exit(1) })