Skip to content

Commit ac28899

Browse files
hdp617grant
authored andcommitted
fix: change the default function directory to the current working directory instead of root ('/') (#77)
1 parent 37ceee7 commit ac28899

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Command-line flag | Environment variable | Description
147147
`--port` | `PORT` | The port on which the Functions Framework listens for requests. Default: `8080`
148148
`--target` | `FUNCTION_TARGET` | The name of the exported function to be invoked in response to requests. Default: `function`
149149
`--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`
150-
`--source` | `FUNCTION_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: `/`
150+
`--source` | `FUNCTION_SOURCE` | The path to the directory of your function. Default: `cwd` (the current working directory)
151151

152152
You can set command-line flags in your `package.json` via the `start` script.
153153
For example:

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const argv = minimist(process.argv, {
6363

6464
const CODE_LOCATION = resolve(
6565
process.cwd(),
66-
argv[FLAG.SOURCE] || process.env[ENV.SOURCE] || '/'
66+
argv[FLAG.SOURCE] || process.env[ENV.SOURCE]
6767
);
6868
const PORT = argv[FLAG.PORT] || process.env[ENV.PORT] || '8080';
6969
const TARGET = argv[FLAG.TARGET] || process.env[ENV.TARGET] || 'function';

0 commit comments

Comments
 (0)