-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add CORS support and transaction routes in app.js
- Loading branch information
1 parent
dce9069
commit 1447e16
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ; |