kykint

Fix startup

Server can now be executed with `npm start`.
...@@ -108,6 +108,4 @@ function handleEvent(event) { ...@@ -108,6 +108,4 @@ function handleEvent(event) {
108 }); 108 });
109 } 109 }
110 110
111 -app.listen(3000, function () { 111 +module.exports = app;
112 - console.log('Linebot listening on port 3000!');
113 -});
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
7 var app = require('../app'); 7 var app = require('../app');
8 var debug = require('debug')('project:server'); 8 var debug = require('debug')('project:server');
9 var http = require('http'); 9 var http = require('http');
10 +var fs = require('fs');
10 11
11 /** 12 /**
12 * Get port from environment and store in Express. 13 * Get port from environment and store in Express.
...@@ -25,7 +26,9 @@ var server = http.createServer(app); ...@@ -25,7 +26,9 @@ var server = http.createServer(app);
25 * Listen on provided port, on all network interfaces. 26 * Listen on provided port, on all network interfaces.
26 */ 27 */
27 28
28 -server.listen(port); 29 +server.listen(port, function () {
30 + console.log('Linebot listening on port ' + port + '!');
31 +});
29 server.on('error', onError); 32 server.on('error', onError);
30 server.on('listening', onListening); 33 server.on('listening', onListening);
31 34
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 "main": "app.js", 5 "main": "app.js",
6 "scripts": { 6 "scripts": {
7 "test": "echo \"Error: no test specified\" && exit 1", 7 "test": "echo \"Error: no test specified\" && exit 1",
8 - "start": "node server.js" 8 + "start": "node ./bin/www"
9 }, 9 },
10 "author": "강수인", 10 "author": "강수인",
11 "license": "MIT", 11 "license": "MIT",
......