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

Add a source flag/env option to add flexibility to execution path #53

Merged
merged 3 commits into from
Aug 1, 2019
Merged

Add a source flag/env option to add flexibility to execution path #53

merged 3 commits into from
Aug 1, 2019

Conversation

gardun0
Copy link
Contributor

@gardun0 gardun0 commented Jul 7, 2019

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.

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: `/`

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',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FUNCTION_SOURCE

@grant
Copy link
Contributor

grant commented Jul 8, 2019

Hey @NotAPineapple and @squee1945.
Thanks for taking on this PR.

Before we continue, can we discuss this feature request in a GitHub issue? This new feature has larger implications than just this library.

Copy link
Contributor

@grant grant left a 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)!

@grant grant merged commit dfa30df into GoogleCloudPlatform:master Aug 1, 2019
@gardun0 gardun0 deleted the grant_source_flag branch August 13, 2019 15:17
@gardun0 gardun0 restored the grant_source_flag branch August 13, 2019 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants