Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
listen to process.env.PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
groovecoder committed Dec 10, 2015
1 parent 653d831 commit 9279bfc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
27 changes: 27 additions & 0 deletions kumascript_settings_local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"log": {
"console": true
},
"server": {
"port": 9080,
"numWorkers": 4,
"workerTimeout": 10000,
"memcache": {
"server": {"127.0.0.1:11211": 1},
"options": { }
},
"macro_timeout": 60000,
"document_url_template": "https://localhost/en-US/docs/{path}?raw=1",
"template_url_template": "https://localhost/en-US/docs/en-US/Template:{name}?raw=1",
"template_class": "EJSTemplate",
"autorequire": {
"mdn": "MDN:Common",
"Date": "DekiScript:Date",
"Page": "DekiScript:Page",
"String": "DekiScript:String",
"Uri": "DekiScript:Uri",
"Web": "DekiScript:Web",
"Wiki": "DekiScript:Wiki"
}
}
}
4 changes: 2 additions & 2 deletions lib/kumascript/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var DEFAULT_CONFIG = {
}
},
server: {
port: 9080,
port: 80,
numWorkers: 4,
workerConcurrency: 4,
workerTimeout: 1000 * 60,
Expand All @@ -40,7 +40,7 @@ var DEFAULT_CONFIG = {
template_cache_control: 'max-age=3600'
},
repl: {
enabled: true,
enabled: false,
host: "127.0.0.1",
port: 9070
}
Expand Down
5 changes: 3 additions & 2 deletions lib/kumascript/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var Server = ks_utils.Class({
// Service accepts these options:
default_options: {
// Port on which the HTTP service will listen.
port: 9000,
port: 9080,
// Template used to resolve incoming URL paths to document source URLs.
document_url_template: "http://localhost:9001/docs/{path}?raw=1",
// Template used to resolve macro names to URLs for the loader.
Expand Down Expand Up @@ -135,7 +135,8 @@ var Server = ks_utils.Class({

// Start the service listening
listen: function (port) {
port = port || this.options.port;
port = process.env.PORT || 9080;
log.info("Server.listen(" + port + ")");
this.app.listen(port);
},

Expand Down

0 comments on commit 9279bfc

Please sign in to comment.