Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84fdd3801a | ||
|
|
954d21c05d | ||
|
|
787eed80b0 |
@@ -3,12 +3,12 @@
|
|||||||
<div class="col-lg-6 col-md-8">
|
<div class="col-lg-6 col-md-8">
|
||||||
<div class="card shadow-sm">
|
<div class="card shadow-sm">
|
||||||
<div class="card-header bg-success text-white">
|
<div class="card-header bg-success text-white">
|
||||||
<h3 class="mb-0">Receive Money</h3>
|
<h3 class="mb-0">Request Money</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-4 text-center">
|
<div class="card-body p-4 text-center">
|
||||||
<!-- Large Amount Display -->
|
<!-- Large Amount Display -->
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<label class="form-label h5">Amount to Receive</label>
|
<label class="form-label h5">Amount to request</label>
|
||||||
<div class="input-group input-group-lg mb-3">
|
<div class="input-group input-group-lg mb-3">
|
||||||
<span class="input-group-text"><i class="bi bi-wallet2"></i></span>
|
<span class="input-group-text"><i class="bi bi-wallet2"></i></span>
|
||||||
<input
|
<input
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
<!-- Shareable Link -->
|
<!-- Shareable Link -->
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<p class="text-muted">Share this link to receive money:</p>
|
<p class="text-muted">Share this link to request money:</p>
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"server": "npm run dev --workspace=server",
|
"server": "npm run dev --workspace=server",
|
||||||
"client": "npm start --prefix client",
|
"client": "npm start --prefix client",
|
||||||
"dev": "concurrently \"npm run server\" \"npm run client\"",
|
"dev": "concurrently \"npm run server\" \"npm run client\""
|
||||||
"teardown": "npm run teardown --workspace=server"
|
|
||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"client",
|
"client",
|
||||||
|
|||||||
@@ -18,7 +18,8 @@
|
|||||||
"hash": "ts-node src/scripts/hash.ts",
|
"hash": "ts-node src/scripts/hash.ts",
|
||||||
"verify-hash": "ts-node src/scripts/verify-hash.ts",
|
"verify-hash": "ts-node src/scripts/verify-hash.ts",
|
||||||
"create-user": "ts-node src/scripts/create-user.ts",
|
"create-user": "ts-node src/scripts/create-user.ts",
|
||||||
"dev": "npm run setup && npm run node; npm run teardown"
|
"dev-bg": "npm run setup && npm run node",
|
||||||
|
"dev": "ts-node src/scripts/dev.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bcrypt": "^6.0.0",
|
"bcrypt": "^6.0.0",
|
||||||
|
|||||||
36
server/src/scripts/dev.ts
Normal file
36
server/src/scripts/dev.ts
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
//Dev-Script
|
||||||
|
//Runs `npm run dev-bg` and listens for interrupts to execute `npm run teardown`
|
||||||
|
import { spawn } from "node:child_process";
|
||||||
|
|
||||||
|
let isShuttingDown = false;
|
||||||
|
|
||||||
|
const child = spawn("npm", ["run", "dev-bg"], {
|
||||||
|
stdio: "inherit",
|
||||||
|
shell: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
async function teardown() {
|
||||||
|
console.log("Running teardown...");
|
||||||
|
const teardownProcess = spawn("npm", ["run", "teardown"], {
|
||||||
|
stdio: "inherit",
|
||||||
|
shell: true,
|
||||||
|
detached: true
|
||||||
|
});
|
||||||
|
|
||||||
|
await new Promise((resolve) => teardownProcess.on("exit", resolve));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function shutdown(signal: any) {
|
||||||
|
if(isShuttingDown) return;
|
||||||
|
isShuttingDown = true;
|
||||||
|
child.kill(signal);
|
||||||
|
await teardown();
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
process.on("SIGINT", () => shutdown("SIGINT"));
|
||||||
|
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
||||||
|
|
||||||
|
child.on("exit", async (code) => {
|
||||||
|
process.exit(code ?? 0);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user