Skip to content

Commit c418972

Browse files
authored
Merge pull request #3 from dknox20/fixed-port
Setting the port to a constant if not specified for easier local testing
2 parents 0ad43b9 + cb9762d commit c418972

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Builds can be started after each deploy, and a few seconds later, you'll be able
2626

2727
The first request returns immediately, and starts generating the CSS in the background:
2828

29-
curl -H "Content-Type: application/json" -X POST -d '{ "page": {"key":"unique-key","url":"http://www.example.com/","css":"https://www.example.com/style.css"}' localhost:8080/api/v1/css
29+
curl -H "Content-Type: application/json" -X POST -d '{ "page": {"key":"unique-key","url":"http://www.example.com/","css":"https://www.example.com/style.css"}}' localhost:5000/api/v1/css
3030
> Accepted
3131

3232
#### Eventually...
3333

34-
curl -H "Content-Type: application/json" -X POST -d '{ "page": {"key":"unique-key","url":"http://www.example.com/","css":"https://www.example.com/style.css"}' localhost:8080/api/v1/css
34+
curl -H "Content-Type: application/json" -X POST -d '{ "page": {"key":"unique-key","url":"http://www.example.com/","css":"https://www.example.com/style.css"}}' localhost:5000/api/v1/css
3535
> .your-critical-css {}
3636

3737

src/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ var workerCount = process.env.CONCURRENCY || 1;
44
var app = require('./app.js')();
55
var queue = require('./generatorQueue.js');
66
var workers = require('./workers.js')(queue);
7+
var port = process.env.PORT || 5000;
78

89
if (cluster.isMaster) {
910
setInterval(function() {
1011
queue.clean(1000 * 60 * 60);
1112
}, 60000);
1213

13-
app.listen(process.env.PORT, function() {
14+
app.listen(port, function() {
1415
console.log('Listening on port:', this.address().port);
1516
});
1617

0 commit comments

Comments
 (0)