Skip to content

Commit

Permalink
errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
MohitPatel1 committed May 10, 2024
1 parent 46c8446 commit 4db4f30
Show file tree
Hide file tree
Showing 7 changed files with 897 additions and 802 deletions.
9 changes: 2 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
LOG_LEVEL=warn
DATABASE_URL=postgres://postgres:12345@localhost:5432/wa_service
DATABASE_URL=postgres://mohit:2456@localhost:5432/wa_service
RECONNECT_INTERVAL=5000
MAX_RECONNECT_RETRIES=5
AUTH_TOKEN=hello1234
CORSOPTIONS = {
origin: '*',
methods: [ 'GET', 'POST', 'PUT', 'DELETE' ],
allowedHeaders: [ 'Content-Type', 'authorization' ],
credentials: true
}
CORSOPTIONS={"origin":"*","methods":["GET","POST","PUT","DELETE"],"allowedHeaders":["Content-Type","authorization"],"credentials":true}
48 changes: 25 additions & 23 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,35 @@ The API documentation is available online [here](https://documenter.getpostman.c

## Setup


```
## `.env` Configurations
```env
# Pino Logger Level
LOG_LEVEL=warn
# Database Connection URL
DATABASE_URL=postgres://postgres:12345@localhost:5432/wa_service
# Reconnect Interval (in Milliseconds)
RECONNECT_INTERVAL=5000
# Maximum Reconnect Attempts
MAX_RECONNECT_RETRIES=5
# Auth token to validate the correct request
AUTH_TOKEN=supersecret
```


1. Copy the `.env.example` file and rename it into `.env`, then update your [connection url](https://www.prisma.io/docs/reference/database-reference/connection-urls) in the `DATABASE_URL` field
1. Update your [provider](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#fields) in the `prisma/schema.prisma` file if you're using database other than MySQL
1. Update your [provider](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#fields) in the `prisma/schema.prisma` file if you're using database other than postgresql
1. Run your [migration](https://www.prisma.io/docs/reference/api-reference/command-reference#prisma-migrate)

```sh
npx prisma migrate (dev|deploy)
npx prisma migrate (dev/deploy)
```

or push the schema
Expand All @@ -82,27 +105,6 @@ CREATE TABLE "Session" (

CREATE INDEX "Session_sessionId_idx" ON "Session"("sessionId");

```


## `.env` Configurations
```env
# Pino Logger Level
LOG_LEVEL=warn
# Database Connection URL
DATABASE_URL=postgres://postgres:12345@localhost:5432/wa_service
# Reconnect Interval (in Milliseconds)
RECONNECT_INTERVAL=5000
# Maximum Reconnect Attempts
MAX_RECONNECT_RETRIES=5
# Auth token to validate the correct request
AUTH_TOKEN=supersecret
```

## Docker Image:
pull the image
```
Expand Down
150 changes: 150 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@types/qrcode": "^1.5.1",
"esbuild": "^0.19.2",
"esbuild-node-tsc": "^2.0.5",
"nodemon": "^3.1.0",
"prisma": "^4.16.1"
}
}
2 changes: 1 addition & 1 deletion src/router/message.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Router } from "express";
import { body, param, query } from "express-validator";
import requestValidator from "../middleware/requestValidator";
import requestValidator from "../middleware/RequestValidator";
import validateSession from "../middleware/validateSession";
import messageController from "../controller/messageController";

Expand Down
2 changes: 1 addition & 1 deletion src/router/session.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Router } from 'express';
import sessionController from '../controller/sessionController';
import { body, query } from "express-validator";
import requestValidator from '../middleware/requestValidator';
import requestValidator from '../middleware/RequestValidator';

const sessionRouter = Router();

Expand Down
Loading

0 comments on commit 4db4f30

Please sign in to comment.