Skip to content

Commit 92d6504

Browse files
committed
init
0 parents  commit 92d6504

File tree

8 files changed

+1940
-0
lines changed

8 files changed

+1940
-0
lines changed

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
yarn.lock
27+
28+
# local env files
29+
.env*.local
30+
.env
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts
38+
39+
# database files
40+
walletData.json
41+
ipData.json

app.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Importing Express and Routes using ES Module syntax
2+
import express from 'express';
3+
import routes from './src/routes/index.js'; // Must include the .js extension in ES Modules
4+
5+
// Initialize Express
6+
const app = express();
7+
8+
// Middleware
9+
app.use(express.json()); // Parse JSON request bodies
10+
11+
// Routes
12+
app.use('/api', routes); // Use routes from the /routes folder
13+
14+
// Global Error Handling Middleware
15+
app.use((err, req, res, next) => {
16+
console.error(err.stack);
17+
res.status(500).send('Something broke!');
18+
});
19+
20+
// Start the server
21+
const PORT = process.env.PORT || 3000;
22+
app.listen(PORT, () => {
23+
console.log(`Server is running on port ${PORT}`);
24+
});

0 commit comments

Comments
 (0)