Skip to content

Commit

Permalink
add CORS support and transaction routes in app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushant-Coder-01 committed Aug 16, 2024
1 parent dce9069 commit 1447e16
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions backend/src/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import express from 'express';
import cors from "cors"

const app = express();

app.use(cors({
origin: process.env.CORS_ORIGIN,
credentials: true
}))

app.use(express.json({limit:"16kb"}))

// import routes

import transactionRouter from '../src/routes/transaction.routes.js'

// route declaration

app.use("/api/transactions",transactionRouter)

export default app ;

0 comments on commit 1447e16

Please sign in to comment.