config in context

This commit is contained in:
Martin McKeaveney 2020-04-06 09:09:48 +01:00
parent a9ba145fce
commit 72fcfd42bb
4 changed files with 6 additions and 5 deletions

View File

@ -23,7 +23,7 @@ router.get("/_builder/api/:appname/appPackage", async ctx => {
router
.post("/_builder/api/:appname/backend", async ctx => {
await saveBackend(
config,
ctx.config,
ctx.params.appname,
ctx.request.body.appDefinition,
ctx.request.body.accessLevels

View File

@ -22,6 +22,7 @@ module.exports = (config, app) => {
.use(async (ctx, next) => {
ctx.sessionId = ctx.session._sessCtx.externalKey
ctx.session.accessed = true
ctx.config = config
const pathParts = ctx.path.split("/")

View File

@ -11,7 +11,7 @@ const router = Router();
router.get("/_builder/api/:appname/components", async ctx => {
try {
ctx.body = getComponentDefinitions(
config,
ctx.config,
ctx.params.appname,
ctx.query.lib
)
@ -27,7 +27,7 @@ router.get("/_builder/api/:appname/components", async ctx => {
router.get("/_builder/api/:appname/componentlibrary", async ctx => {
const info = await componentLibraryInfo(
config,
ctx.config,
ctx.params.appname,
ctx.query.lib ? decodeURI(ctx.query.lib) : ""
)
@ -37,7 +37,7 @@ router.get("/_builder/api/:appname/componentlibrary", async ctx => {
router.get("/_builder/:appname/componentlibrary", async ctx => {
const info = await componentLibraryInfo(
config,
ctx.config,
ctx.params.appname,
ctx.query.lib
)

View File

@ -59,7 +59,7 @@ router
router.post("/_builder/api/:appname/pages/:pageName", async ctx => {
await buildPage(
config,
ctx.config,
ctx.params.appname,
ctx.params.pageName,
ctx.request.body