Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug on the doc page 'Using current context' #2438

Closed
upupzealot opened this issue Jun 15, 2016 · 6 comments
Closed

A bug on the doc page 'Using current context' #2438

upupzealot opened this issue Jun 15, 2016 · 6 comments
Assignees
Labels

Comments

@upupzealot
Copy link

It says

LoopBack context is now enabled by default for REST APIs via loopback.rest() middleware. Configure it in server/config.json as follows:

"remoting": {
  "context": {
    "enableHttpContext": false
  },
  ...
}

but actually you have to set enableHttpContext to true not false

link: https://docs.strongloop.com/display/APIC/Using+current+context

@seriousben
Copy link
Contributor

seriousben commented Jun 16, 2016

Actually it is enabled by default. enableHttpContext only let's the req and res be added to it.
You can disable by setting:

"remoting": {
  "context": false,
  ...
}

Which does not disable cls itself unfortunately. I have this as a requirement right now, I created #2439 do handle it.

@superkhau
Copy link
Contributor

@crandmck ^

@upupzealot
Copy link
Author

@seriousben I don't think it's enabled by default.
I created a new project and the enableHttpContext is set to false.
Since the doc says I can enable it by setting it to false, that's weird, I think it should be true in the doc

@crandmck crandmck assigned Sequoia and unassigned crandmck Aug 16, 2016
@Sequoia
Copy link
Collaborator

Sequoia commented Sep 27, 2016

I created a new project and the enableHttpContext is set to false.

Here's my server config from a brand new scaffolded Loopback 2.34.1 application:

{
  "restApiRoot": "/api",
  "host": "0.0.0.0",
  "port": 3000,
  "remoting": {
    "context": false,
    "rest": {
      "normalizeHttpPath": false,
      "xml": false
    },
    "json": {
      "strict": false,
      "limit": "100kb"
    },
    "urlencoded": {
      "extended": true,
      "limit": "100kb"
    },
    "cors": false,
    "handleErrors": false
  },
  "legacyExplorer": false
}

remoting.context.enableHttpContext is not present. Is this issue resolved?

@crandmck
Copy link
Contributor

@bajtos Since currentContext is deprecated, should we spend time on this issue?

@bajtos
Copy link
Member

bajtos commented Sep 30, 2016

As part of working on #2439, I have changed the doc page a bit. Right now, new applications are scaffolded with context: false and the option was removed from LoopBack 3.0 completely.

I am closing this issue as fixed.

@bajtos bajtos closed this as completed Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants