Setup api and express

This commit is contained in:
Justin xzHome
2025-07-05 23:51:56 +09:00
commit 0ab11f4644
5 changed files with 1539 additions and 0 deletions

1482
api/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

22
api/package.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "ecommerce-api",
"version": "1.0.0",
"description": "",
"license": "ISC",
"author": "",
"type": "module",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev" : "node --import=tsx --watch --env-file=.env src/index.ts",
"build": "tsc"
},
"dependencies": {
"express": "^5.1.0"
},
"devDependencies": {
"@types/express": "^5.0.3",
"tsx": "^4.20.3",
"typescript": "^5.8.3"
}
}

12
api/src/index.ts Normal file
View File

@@ -0,0 +1,12 @@
import express from 'express';
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello World! 123')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})