Skip to content

Commit 68c0662

Browse files
committed
refactor node-micro example to remove node 8 bin
1 parent 63874be commit 68c0662

File tree

3 files changed

+4
-30
lines changed

3 files changed

+4
-30
lines changed

oss/node-micro/Makefile

Lines changed: 0 additions & 2 deletions
This file was deleted.

oss/node-micro/Readme.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Node Micro
22

3-
Run the [`micro`](https://github.com/zeit/micro) binary with a non-native Node v8.x runtime.
4-
5-
> This example builds upon the [`node-8` example](https://github.com/apex/up-examples/blob/master/oss/node-8).
3+
Run the [`micro`](https://github.com/zeit/micro) binary.
64

75
This makes us of `async`/`await` and demonstrates a GraphQL query (bonus).
86

@@ -22,26 +20,14 @@ $ up
2220

2321
## Notes
2422

25-
The `build` hook in `up.json` simply runs `make`, which downloads the `node-v8.9.0-linux-x64` into the root directory.
26-
27-
```json
28-
{
29-
"hooks": {
30-
"build": "make"
31-
}
32-
}
33-
```
34-
35-
The `proxy.command` script is run inside Lambda to start your server.
36-
37-
We use our "custom" `node` binary (`node-v8.9.0-linux-x64`) to run the `micro` binary, specifying the host & port values.
23+
The `proxy.command` script is run inside Lambda to start your server, used here to specify the host & port values for `micro`.
3824

3925
> **Note**: Micro's default `host` value is `::`, which is not compatible with Lambda; using `localhost` works, though! Also note that the micro(1) binary itself does literally nothing other than start your server, so node-micro-alt would be more idioimatic Node.js code.
4026
4127
```json
4228
{
4329
"proxy": {
44-
"command": "./node-v8.9.0-linux-x64/bin/node node_modules/.bin/micro --host localhost --port $PORT"
30+
"command": "./node_modules/.bin/micro --host localhost --port $PORT"
4531
}
4632
}
4733
```

oss/node-micro/up.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
{
22
"name": "app",
3-
"hooks": {
4-
"build": "make"
5-
},
63
"proxy": {
7-
"command": "./node-v8.9.4-linux-x64/bin/node node_modules/.bin/micro --host localhost --port $PORT"
4+
"command": "micro --host localhost --port $PORT"
85
},
96
"lambda": {
107
"memory": 1024
11-
},
12-
"stages": {
13-
"development": {
14-
"proxy": {
15-
"command": "micro --host localhost --port $PORT"
16-
}
17-
}
188
}
199
}

0 commit comments

Comments
 (0)