const express = require('express');
const axios = require('axios');
const app = express();
app.set('view engine', 'ejs');
app.get('/', async (req, res) => {
const response = await axios.get('https://jsonplaceholder.typicode.com/users');
res.render('users', { users: response.data });
});
app.listen(3000, () => {
console.log('Server running at http://localhost:3000');
});
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter