Skip to content

Instantly share code, notes, and snippets.

@robinandeer
Created August 2, 2019 21:55
Show Gist options
  • Save robinandeer/78af1e38dd09bae051261901fb3303ef to your computer and use it in GitHub Desktop.
Save robinandeer/78af1e38dd09bae051261901fb3303ef to your computer and use it in GitHub Desktop.
Missing logs in Zeit Now
{
"name": "test-log",
"version": 2,
"builds": [{ "src": "server.js", "use": "@now/node" }],
"routes": [{ "src": "/api/users(.*)", "dest": "/server.js" }]
}
{
"name": "test-log",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.19.0",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"express": "^4.17.1",
"express-winston": "^3.2.1",
"helmet": "^3.20.0",
"winston": "^3.2.1"
}
}
const express = require("express");
const axios = require("axios");
const winston = require("winston");
const expressWinston = require("express-winston");
const app = express();
app.use(
expressWinston.logger({
transports: [new winston.transports.Console()],
meta: true,
expressFormat: true
})
);
app.get("/api/users", async (req, res) => {
console.info("get.users.all");
res.json((await axios.get("https://smileys.now.sh/api/users")).data);
});
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment