More docker, express and config setup

This commit is contained in:
Florian Sylvain
2023-01-26 14:47:41 +01:00
parent 9a890135bc
commit 2082c9330c
7 changed files with 112 additions and 9 deletions
+18 -1
View File
@@ -1 +1,18 @@
console.log('pouet]')
import { PrismaClient } from '@prisma/client'
import express from 'express'
import * as dotenv from 'dotenv'
dotenv.config()
const app = express()
const prisma = new PrismaClient()
const port = process.env.API_PORT
app.use(express.json())
app.use(express.urlencoded({ extended: false }))
app.get('/v1/', async (req, res, next) => {
res.send({ code: 200, message: "SnippetsManager v1.0" })
})
app.listen(port, () => console.log(`Listening on port ${port}`))