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