UNPKG

579 BPlain TextView Raw
1import { ContextFactory } from "@proerd/nextpress/lib/context"
2import { websiteContext } from "@proerd/nextpress/lib/context/mappers/website"
3import { mailgunContext } from "@proerd/nextpress/lib/context/mappers/mailgun"
4import { knexContext } from "@proerd/nextpress/lib/context/mappers/knex"
5import path = require("path")
6
7let context: Nextpress.Context
8
9export function getContext() {
10 if (context) return context
11 context = ContextFactory({
12 projectRoot: path.resolve(__dirname, ".."),
13 mappers: [websiteContext, mailgunContext, knexContext],
14 })
15 return context
16}