Skip to content

Commit 11c74af

Browse files
committed
update README
1 parent f3fa19f commit 11c74af

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ npm install @google-cloud/functions-framework
6868
};
6969
```
7070

71+
Option 1:
72+
7173
1. Run the following command:
7274

7375
```sh
@@ -76,6 +78,33 @@ npm install @google-cloud/functions-framework
7678

7779
1. Open http://localhost:8080/ in your browser and see _Hello, World_.
7880

81+
Option 2:
82+
83+
1. Create a `main.js` file with the following contents:
84+
85+
```js
86+
import { run } from '@google-cloud/functions-framework';
87+
import { helloWorld } from './hello.js';
88+
89+
run(helloWorld);
90+
```
91+
92+
1. Run `node main.js` to start the local development server to serve the function:
93+
94+
```
95+
Serving function...
96+
Function: function
97+
Signature type: http
98+
URL: http://localhost:8080/
99+
```
100+
101+
1. Send requests to this function using `curl` from another terminal window:
102+
103+
```sh
104+
curl localhost:8080
105+
# Output: Hello, World
106+
```
107+
79108
### Quickstart: Set up a new project
80109
81110
1. Create a `package.json` file using `npm init`:

test/integration/programmatic.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ describe('programmatic functions', () => {
6565
});
6666

6767
it('should run a CloudEvent function', async () => {
68+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6869
let receivedEvent: any = null;
6970
const cloudEventFunc: CloudEventFunction = cloudEvent => {
7071
receivedEvent = cloudEvent;

0 commit comments

Comments
 (0)