nodejs-template / index.js
tomayac's picture
Update index.js
b52b065 verified
raw
history blame contribute delete
437 Bytes
import express from "express";
const app = express();
const port = 7860;
app.get('/', async (req, res) => {
res.send(
`Running Express.js ${
(
await import('express/package.json', {
with: { type: 'json' },
})
).default.version
} on Node.js ${process.version.split('.')[0].replace('v', '')}`,
);
});
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});