diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:26:46 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:43:56 -0700 |
| commit | e4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 (patch) | |
| tree | 06284a538a6008eca75051399e47db4e5d50301c /backend/src/index.ts | |
initial commit: scaffolding
Diffstat (limited to 'backend/src/index.ts')
| -rw-r--r-- | backend/src/index.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/backend/src/index.ts b/backend/src/index.ts new file mode 100644 index 0000000..fef1977 --- /dev/null +++ b/backend/src/index.ts @@ -0,0 +1,20 @@ +import express from 'express'; +import cors from 'cors'; +import { PrismaClient } from '@prisma/client'; + +const app = express(); +const port = 5000; + +app.use(cors()); +app.use(express.json()); + +const prisma = new PrismaClient(); + +app.get('/api/users', async (req, res) => { + const users = await prisma.user.findMany(); + res.json(users); +}); + +app.listen(port, () => { + console.log(`Server listening on port ${port}`); +}); |
