Convert any log file into JSON and serve it as an API.
Forked from es6-babel-express-mocha-starter.
# pre-setup
npm install -g nodemon babel-cli mocha # may need "sudo"
# setup
git clone https://github.com/500tech/nodejs-express-es6.git
cd nodejs-express-es6
npm install
# start the server (starts babel-node with nodemon)
npm start
# open in browser
http://localhost:3000
# build for production (output to dist folder)
npm run build
Brought to you with love, from us at 500Tech - Israel's leading AngularJS consultancy
Forked by @underscoredam
- URL
/ - Methods
GET - Responses
- Code: 200
- Response:
{ "code": 0, "availableConfigs": ['nginx_access_log', ...] }
- URL
/<config> - Methods
GET - Responses
- Code: 200
- Response:
{ "code": 0, "logs": [row1, row2, ...] }
Default nginx access log located at /var/www/nginx/access.log.
- Example:
{
"remote_addr": "127.0.0.1",
"remote_user": "-",
"date": "26/Feb/2017:08:03:43 -0600",
"request": "HEAD / HTTP/1.1",
"status": 200,
"body_bytes_sent": 0,
"http_referrer": "-",
}The MIT License