-
Notifications
You must be signed in to change notification settings - Fork 158
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
Add a source flag/env option to add flexibility to execution path #53
Conversation
README.md
Outdated
@@ -147,6 +147,7 @@ Command-line flag | Environment variable | Description | |||
`--port` | `PORT` | The port on which the Functions Framework listens for requests. Default: `8080` | |||
`--target` | `FUNCTION_TARGET` | The name of the exported function to be invoked in response to requests. Default: `function` | |||
`--signature-type` | `FUNCTION_SIGNATURE_TYPE` | The signature used when writing your function. Controls unmarshalling rules and determines which arguments are used to invoke your function. Default: `http`; accepted values: `http` or `event` | |||
`--source` | `SOURCE` | The path of your project directory where you want to start. Functions framework always look only at root path, setting this option will look for your function in any other folder. Default: `/` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Env variable needs to be prefixed: FUNCTION_SOURCE
src/index.ts
Outdated
}; | ||
|
||
// Supported environment variables | ||
const ENV = { | ||
PORT: 'PORT', | ||
TARGET: 'FUNCTION_TARGET', | ||
SIGNATURE_TYPE: 'FUNCTION_SIGNATURE_TYPE', // underscore | ||
SOURCE: 'SOURCE', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FUNCTION_SOURCE
Hey @NotAPineapple and @squee1945. Before we continue, can we discuss this feature request in a GitHub issue? This new feature has larger implications than just this library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! Thanks for your contribution (and your patience)!
Hey,
In my use of Cloud Functions, i've encountered with the situation of using different folders to hold my functions, so this will be helpful for me and any others.