Skip to content

mounted app.context doesn't get applied to parent app #64

@Nostradamos

Description

@Nostradamos

Example:

const mount = require('koa-mount');
const Koa = require('koa');

const a = new Koa();
a.context.test = "hallo";

a.use(async function (ctx, next){
    ctx.body = "test:" + ctx.test;
    return next();
});

// app

const app = new Koa();

app.use(mount('/hello', a));
app.listen(3000)
a.listen(3001);

http://localhost:3000/hello results in test:hallo
http://localhost:3001/hello results in test:undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions