Skip to content

Instantly share code, notes, and snippets.

@fizerkhan
Created June 7, 2017 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fizerkhan/43761c53a5dc4888dd0abe48947bbe92 to your computer and use it in GitHub Desktop.
Save fizerkhan/43761c53a5dc4888dd0abe48947bbe92 to your computer and use it in GitHub Desktop.
Atatus Node Agent with ES6
import http from 'http';
import express from 'express';
import morgan from 'morgan';
import bodyParser from 'body-parser';
let app = express();
app.server = http.createServer(app);
app.use(morgan('dev'));
app.use(bodyParser.json({}));
app.get('/', (req, res) => {
res.json({ version: '1.0.0' });
});
app.get('/health', (req, res) => {
res.json({ status: 'Good' });
});
app.server.listen(process.env.PORT || 9000, () => {
console.log(`Started on port ${app.server.address().port}`);
});
export default app;
var atatus = require("atatus-node");
atatus.start({ apiKey: 'your_api_key' });
module.exports = require('./app.js');
@fizerkhan
Copy link
Author

You can execute as

    babel-node src --presets es2015,stage-0 index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment