We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Current Behavior env set in launch.json are not set in process.env.
Sample Code file: launch.json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 //"program": "${workspaceFolder}/node_modules/serverless/bin/serverless", "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "program": "${userHome}/AppData/Roaming/npm/node_modules/serverless/bin/serverless", "args": [ "offline", "start", "--httpPort", "4000", "--noTimeout", ], "runtimeExecutable": "node", "runtimeArgs": [ "--preserve-symlinks-main", "--preserve-symlinks" ], "stopOnEntry": true, "env": {"MYVAR": "value"} } ] }
Sample Code file: handler.js module.exports.hello = async (event) => { const { MYVAR} = process.env; return { statusCode: 200, body: JSON.stringify('Hello ' + robert ) }; };
Sample Code file: serverless.yml service: roberts
frameworkVersion: '3'
provider: name: aws runtime: nodejs18.x
plugins:
functions: hello: handler: handler.hello events: - http: path: /hello method: get cors: true
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report
Current Behavior
env set in launch.json are not set in process.env.
Sample Code
file: launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
//"program": "${workspaceFolder}/node_modules/serverless/bin/serverless",
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${userHome}/AppData/Roaming/npm/node_modules/serverless/bin/serverless",
"args": [
"offline",
"start",
"--httpPort",
"4000",
"--noTimeout",
],
"runtimeExecutable": "node",
"runtimeArgs": [
"--preserve-symlinks-main",
"--preserve-symlinks"
],
"stopOnEntry": true,
"env": {"MYVAR": "value"}
}
]
}
Sample Code
file: handler.js
module.exports.hello = async (event) => {
const { MYVAR} = process.env;
return {
statusCode: 200,
body: JSON.stringify('Hello ' + robert )
};
};
Sample Code
file: serverless.yml
service: roberts
frameworkVersion: '3'
provider:
name: aws
runtime: nodejs18.x
plugins:
functions:
hello:
handler: handler.hello
events:
- http:
path: /hello
method: get
cors: true
The text was updated successfully, but these errors were encountered: