This commit is contained in:
bade 2024-03-14 18:06:58 +01:00
parent 341889b6f7
commit 26b23a3ecc
7 changed files with 1372 additions and 1262 deletions

View File

@ -1,7 +1,7 @@
NODE_ENV="development"
MONGO_URL=""
MONGO_URL="mongodb://localhost:27017/BudgetBuddy"
PORT="2011"
TZ="Europe/Paris"

View File

@ -13,7 +13,7 @@
"format": "prettier --write '**/*.{js,jsx,ts}'",
"lint": "eslint . && yarn check-types",
"setup": "yarn install",
"start:development": "nodemon",
"start": "nodemon",
"start:production": "node dist/index.js",
"test": "cross-env NODE_ENV=test jest",
"test:cov": "cross-env NODE_ENV=test jest --coverage"

View File

@ -15,6 +15,7 @@ import { Express } from '@types'
import cookieParser from 'cookie-parser'
import cors from 'cors'
import dotenv from 'dotenv'
import * as process from "process";
dotenv.config()

View File

@ -106,7 +106,7 @@ export const createUser = async (
} catch (error) {
return {
status: HttpStatus.INTERNAL_SERVER_ERROR,
error: 'Internal server error',
error: `Internal server error`,
}
}
@ -229,7 +229,7 @@ export const updateUser = async (
} catch (error) {
return {
status: HttpStatus.INTERNAL_SERVER_ERROR,
error: 'Internal server error',
error: 'Internal server error testing',
}
}

View File

@ -1,7 +1,7 @@
import mongoose from 'mongoose'
import { MONGO_URL } from "../../../env";
export const databaseConnection = async () => {
const mongoUrl: string = decodeURIComponent(process.env.MONGO_URL || '')
const mongoUrl: string = decodeURIComponent(process.env.MONGO_URL || MONGO_URL || '')
if (mongoUrl === '') {
throw new Error('MONGO_URL has not been set')

View File

@ -8,7 +8,6 @@ const router = express.Router()
router.get('/', authenticated, async (req: AuthenticatedRequest, res: Response) => {
const response = await getUsers(<IGetUserInput>req.query, <IUser>req.user)
return res.status(response.status).send(response.data || response.error)
})

2620
yarn.lock

File diff suppressed because it is too large Load Diff