Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
|
@@ -3,14 +3,16 @@ import express from 'express';
|
|
| 3 |
const app = express();
|
| 4 |
const port = 7860;
|
| 5 |
|
| 6 |
-
|
| 7 |
with: { type: 'json' }
|
| 8 |
-
})
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
app.get('/', (req, res) => {
|
| 13 |
-
res.send(`Running Node.js with Express.js`);
|
| 14 |
});
|
| 15 |
|
| 16 |
app.listen(port, () => {
|
|
|
|
| 3 |
const app = express();
|
| 4 |
const port = 7860;
|
| 5 |
|
| 6 |
+
const expressVersion = (await import('express/package.json', {
|
| 7 |
with: { type: 'json' }
|
| 8 |
+
}).default.version;
|
| 9 |
|
| 10 |
+
const nodeVersion = process.version.split('.')[0];
|
| 11 |
+
|
| 12 |
+
console.log(`Running Node.js ${nodeVersion} with Express.js ${expressVersion}`);
|
| 13 |
|
| 14 |
app.get('/', (req, res) => {
|
| 15 |
+
res.send(`Running Node.js ${nodeVersion} with Express.js ${expressVersion}`);
|
| 16 |
});
|
| 17 |
|
| 18 |
app.listen(port, () => {
|