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

express middleware access to process #865

Closed
j3ko opened this issue Mar 23, 2018 · 1 comment
Closed

express middleware access to process #865

j3ko opened this issue Mar 23, 2018 · 1 comment

Comments

@j3ko
Copy link

j3ko commented Mar 23, 2018

Context

After following http://docs.deployd.com/docs/server/work-with-express.html and installing deployd as express middleware, the event scripts no longer have access to the nodejs process global.

Expected Behavior

in some arbitrary get.js, put.js, post.js, etc. file the following should execute properly

var key = process.env['SOME_KEY'] // key should be set properly
var cwd = process.cwd() // cwd should be set properly

Actual Behavior

var key = process.env['SOME_KEY']

throws: "Cannot read property 'SOME_KEY' of undefined"

var cwd = process.cwd()

throws: "process.cwd is not a function"

Steps to Reproduce

  1. follow http://docs.deployd.com/docs/server/work-with-express.html
  2. in some event call var cwd = process.cwd()

Your Environment

  • Deployd Version (deployd -V): 1.1.2
  • Node version (node -v): 8.1.3
@rgolea
Copy link
Member

rgolea commented Jan 5, 2023

Hey! You have to use process().

@rgolea rgolea closed this as completed Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants