-
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.
Merge pull request #42 from Praashh/inmemory/orderbook
feat: opx-orderbook
- Loading branch information
Showing
5 changed files
with
87 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "opx-orderbook", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node dist/index.js", | ||
"build": "npx esbuild ./src/index.ts --bundle --platform=node --outfile=dist/index.js", | ||
"dev": "npm run build && npm run start" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"description": "", | ||
"dependencies": { | ||
"@repo/db": "*", | ||
"@repo/order-queue": "*", | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"body-parser": "^1.20.3", | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.4.5", | ||
"express": "^4.21.0" | ||
}, | ||
"devDependencies": { | ||
"esbuild": "0.24.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import prisma from "@repo/db/client"; | ||
import { redisClient } from "@repo/order-queue"; | ||
import express from "express"; | ||
import cors from "cors"; | ||
import bodyParser from "body-parser"; | ||
import orderRouter from "./routes/placeorders" | ||
|
||
const app = express(); | ||
|
||
app.use(cors()); | ||
app.use(bodyParser.json()); | ||
app.use("/v1/order", orderRouter); | ||
|
||
app.get("/", (req, res) => { | ||
redisClient.connect().then(() => { | ||
console.log("Connected to Redis"); | ||
}); | ||
res.send("Helo helo"); | ||
}); | ||
|
||
app.listen(3002, () => { | ||
console.log(`Server is running at http://localhost:3002`); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Router } from "express"; | ||
const router = Router(); | ||
|
||
router.post("/placeorder", async (req, res)=>{ | ||
res.json({message: "working"}); | ||
}) | ||
|
||
export default router; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "@repo/typescript-config/base.json", | ||
"compilerOptions": { | ||
"outDir": "dist" | ||
}, | ||
"include": ["src"], | ||
"exclude": ["node_modules", "dist"] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.