1 | import { ContextFactory } from "@proerd/nextpress/lib/context"
|
2 | import { websiteContext } from "@proerd/nextpress/lib/context/mappers/website"
|
3 | import { mailgunContext } from "@proerd/nextpress/lib/context/mappers/mailgun"
|
4 | import { knexContext } from "@proerd/nextpress/lib/context/mappers/knex"
|
5 | import path = require("path")
|
6 |
|
7 | let context: Nextpress.Context
|
8 |
|
9 | export 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 | }
|