Merge pull request #18 from iantsch/change-port

Allow custom port on startup
This commit is contained in:
Mario Zechner 2023-05-25 19:45:07 +02:00 committed by GitHub
commit b6f943e903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,8 @@ Merged price history
Example app listening on port 3000
```
Once the app is listening on port 3000, open http://localhost:3000 in your browser.
Once the app is listening per default on port 3000, open http://localhost:3000 in your browser.\
**Note**: If you want to start on a different port add it as the third parameter, e.g. `node index.js 3001` will map to port `3001`.
Subsequent starts will fetch the data asynchronously, so you can start working immediately.

View File

@ -20,7 +20,7 @@ let itemsJson = "";
const express = require('express')
const compression = require('compression');
const app = express()
const port = 3000
const port = process?.argv?.[2] ?? 3000
app.use(express.static('site'));
app.use(compression());