Skip to content

Commit 8fb0c22

Browse files
committed
node-express-ncc: add example
1 parent 61723ff commit 8fb0c22

File tree

9 files changed

+20425
-0
lines changed

9 files changed

+20425
-0
lines changed

oss/node-express-ncc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

oss/node-express-ncc/.upignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!package.json
3+
!server/**

oss/node-express-ncc/Readme.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
# Node Express
3+
4+
Express application using the ncc bundler.
5+
6+
## Setup
7+
8+
```
9+
$ yarn
10+
```
11+
12+
## Deploy
13+
14+
```
15+
$ up
16+
```
17+
18+
## Notes
19+
20+
Create an `.upignore` file to omit everything except our package.json and ./server files:
21+
22+
```
23+
*
24+
!package.json
25+
!server/**
26+
```
27+
28+
The Up proxy command in up.json is changed to `node server/index.js` instead of the default `node app.js`,
29+
allowing staging and production to run the build.
30+
31+
## Links
32+
33+
- [ncc](https://github.com/zeit/ncc) bundler alternative to Webpack

oss/node-express-ncc/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const express = require('express')
2+
const app = express()
3+
4+
const { PORT = 3000 } = process.env
5+
6+
app.get('/', function(req, res){
7+
res.send('Hello World from Express!')
8+
})
9+
10+
console.log('listening on %s', PORT)
11+
app.listen(PORT)

oss/node-express-ncc/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"scripts": {
3+
"start": "node app"
4+
},
5+
"dependencies": {
6+
"express": "^4.15.3"
7+
}
8+
}

0 commit comments

Comments
 (0)