1
0
Fork 0
mirror of synced 2024-07-02 04:50:44 +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
.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