summary refs log tree commit diff
path: root/scripts/stress/login.js
blob: 473e2e95653c2844041151977332004cf366a4c1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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();