feat: 초기 프로젝트 설정 및 룰.md 파일 추가
This commit is contained in:
14
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/README.md
generated
vendored
Normal file
14
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/README.md
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
# Basic HTTP Server and Cluster mode
|
||||
|
||||
In this boilerplate it will start an http server in cluster mode.
|
||||
|
||||
You can check the content of the ecosystem.config.js on how to start mutliple instances of the same HTTP application in order to get the most from your working system.
|
||||
|
||||
## Via CLI
|
||||
|
||||
Via CLI you can start any HTTP/TCP application in cluster mode with:
|
||||
|
||||
```bash
|
||||
$ pm2 start api.js -i max
|
||||
```
|
||||
9
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/api.js
generated
vendored
Normal file
9
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/api.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
var http = require('http');
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
res.writeHead(200);
|
||||
res.end('hey');
|
||||
}).listen(process.env.PORT || 8000, function() {
|
||||
console.log('App listening on port %d', server.address().port);
|
||||
});
|
||||
14
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/ecosystem.config.js
generated
vendored
Normal file
14
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/ecosystem.config.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
apps : [{
|
||||
name: 'API',
|
||||
script: 'api.js',
|
||||
instances: 4,
|
||||
max_memory_restart: '1G',
|
||||
env: {
|
||||
NODE_ENV: 'development'
|
||||
},
|
||||
env_production: {
|
||||
NODE_ENV: 'production'
|
||||
}
|
||||
}]
|
||||
};
|
||||
11
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/package.json
generated
vendored
Normal file
11
api.hyungi.net/node_modules/pm2/lib/templates/sample-apps/http-server/package.json
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "simple-http-server",
|
||||
"version": "1.0.0",
|
||||
"description": "Simple HTTP server that can be used in cluster mode",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
Reference in New Issue
Block a user