Skip to content

Unable to extend the app's context in Koa@2 #652

@alewaros

Description

@alewaros

Trying to extend the context of the application since migrating to koa@2 throws this error:

TypeError: Cannot set property 'property_name' of #<Object> which has only a getter

A small example code

import Koa from 'koa';

const app = new Koa();
app.context.host = process.env.HOST || '0.0.0.0';
app.context.port = process.env.PORT || 8080;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions