Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,253 changes: 2,465 additions & 2,788 deletions db.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/nike.png" />
<link rel="icon" type="image/svg+xml" href="/clothify.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Clothify</title>
</head>
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

19 changes: 19 additions & 0 deletions proxy/db.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"posts": [
{
"id": 1,
"title": "json-server",
"author": "typicode"
}
],
"comments": [
{
"id": 1,
"body": "some comment",
"postId": 1
}
],
"profile": {
"name": "typicode"
}
}
26 changes: 26 additions & 0 deletions proxy/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import express from "express";
import cors from "cors";
import Khalti from "khalti-js/dist/index.mjs";

const app = express();

const k = new Khalti({
mode: "Sandbox",
returnUrl: "http://localhost:3030/cart",
websiteUrl: "http://localhost:3030",
secretKey: "add the token",
});

app.use(express.json());
app.use(cors());

app.post("/", async (req, res) => {
const returnUrl = await k.getPaymentUrl({
amount: req.body.amount,
purchase_order_id: req.body.purchaseOrderId,
purchase_order_name: req.body.purchaseOrderName,
});
res.json({ returnUrl });
});

app.listen(3030, () => console.log("Server running on port 3030"));
Loading