create-backlist 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-backlist",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "An advanced, multi-language backend generator based on frontend analysis.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node bin/index.js"
|
|
11
11
|
},
|
|
12
|
-
"author": "
|
|
12
|
+
"author": "W.A.H.ISHAN",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@babel/parser": "^7.22.7",
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import express from 'express';
|
|
1
|
+
import express, { Express, Request, Response } from 'express';
|
|
2
2
|
import cors from 'cors';
|
|
3
3
|
import dotenv from 'dotenv';
|
|
4
4
|
|
|
5
5
|
dotenv.config();
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
const app: Express = express(); // Added :Express type
|
|
8
|
+
|
|
7
9
|
app.use(cors());
|
|
8
10
|
app.use(express.json());
|
|
9
11
|
|
|
10
|
-
app.get('/', (req, res) =>
|
|
12
|
+
app.get('/', (req: Request, res: Response) => { // Added :Request and :Response types
|
|
13
|
+
res.send('Node.js Backend says Hello! Generated by Backlist.');
|
|
14
|
+
});
|
|
11
15
|
|
|
12
16
|
// INJECT:ROUTES
|
|
13
17
|
|
|
14
|
-
const PORT = process.env.PORT || 8000;
|
|
15
|
-
|
|
18
|
+
const PORT: number | string = process.env.PORT || 8000; // Added type for PORT
|
|
19
|
+
|
|
20
|
+
app.listen(PORT, () => {
|
|
21
|
+
console.log(`⚡️ Server running on http://localhost:${PORT}`);
|
|
22
|
+
});
|