create-uk-node-server 1.0.0 → 1.0.1
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,28 +1,24 @@
|
|
1
1
|
import express from 'express';
|
2
2
|
import cors from 'cors';
|
3
3
|
import dotenv from 'dotenv';
|
4
|
-
import { connectDB } from './utils/db.config';
|
4
|
+
import { connectDB } from './utils/db.config.js';
|
5
|
+
import indexRoutes from './routes/index.route.js';
|
5
6
|
|
6
7
|
dotenv.config();
|
7
8
|
|
8
9
|
const app = express();
|
9
10
|
const PORT = process.env.APP_PORT || 3000;
|
10
11
|
|
11
|
-
// Middleware
|
12
12
|
app.use(cors());
|
13
13
|
app.use(express.json());
|
14
14
|
app.use(express.urlencoded({ extended: true }));
|
15
15
|
|
16
|
-
// Routes
|
17
16
|
app.get('/', (req, res) => {
|
18
17
|
res.json({ message: 'Welcome to TypeScript Server!' });
|
19
18
|
});
|
20
19
|
|
21
|
-
// Import routes
|
22
|
-
import indexRoutes from './routes/index.route';
|
23
20
|
app.use('/api', indexRoutes);
|
24
21
|
|
25
|
-
// Start server
|
26
22
|
const startServer = async () => {
|
27
23
|
try {
|
28
24
|
await connectDB();
|
@@ -35,4 +31,4 @@ const startServer = async () => {
|
|
35
31
|
}
|
36
32
|
};
|
37
33
|
|
38
|
-
startServer();
|
34
|
+
startServer();
|
@@ -11,9 +11,7 @@
|
|
11
11
|
"forceConsistentCasingInFileNames": true,
|
12
12
|
"moduleResolution": "node",
|
13
13
|
"resolveJsonModule": true,
|
14
|
-
"declaration": true
|
15
|
-
"declarationMap": true,
|
16
|
-
"sourceMap": true
|
14
|
+
"declaration": true
|
17
15
|
},
|
18
16
|
"include": ["src/**/*"],
|
19
17
|
"exclude": ["node_modules", "dist"]
|