summary refs log tree commit diff
path: root/scripts/stress/login.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/stress/login.js')
-rw-r--r--scripts/stress/login.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/stress/login.js b/scripts/stress/login.js
new file mode 100644
index 00000000..473e2e95
--- /dev/null
+++ b/scripts/stress/login.js
@@ -0,0 +1,17 @@
+const fetch = require("node-fetch");
+const ENDPOINT = process.env.API || "http://localhost:3001";
+
+async function main() {
+	const ret = await fetch(`${ENDPOINT}/api/auth/login`, {
+		method: "POST",
+		body: JSON.stringify({
+			login: process.argv[2],
+			password: process.argv[3],
+		}),
+		headers: { "content-type": "application/json " },
+	});
+
+	console.log((await ret.json()).token);
+}
+
+main();