app.js 536 Bytes
const express = require('express');
const app = express();

const config = require('./common/config');

const logger = require('yoho-node-lib/lib/logger').init(config);

global.yoho = {
    logger,
    config
};

const middleware = require('./middleware');

app.get('/yas.gif', middleware.apm);

app.use('*', (req, res) => {
    res.statusCode = 404;
    res.send();
});
app.use((err, req, res) => {
    logger.error('error:', err);
    res.send();
});

app.listen(6003, () => {
    logger.info(`yoho apm start at ${config.port}`);
});