1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +12:00

config in context

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

View file

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

View file

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

View file

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

View file

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