mirror of
https://github.com/spacebarchat/server.git
synced 2026-06-07 06:41:46 +00:00
17 lines
424 B
JavaScript
17 lines
424 B
JavaScript
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().then(() => {});
|