blob: 045f40897f03cacaa994d09c9d39ac90db281d12 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
"use strict";
import { Request, Response } from 'express';
import fetch from "node-fetch";
export default async function apiLogin(req: Request, res: Response) {
let response = await fetch("https://jopek.eu/maks/szkola/apkKli/fiaFiles/fia.php", {
method: "POST",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
apiKey: process.env.API_KEY,
stmt: "SELECT `data` FROM `fia` WHERE `started`= ?",
params: [false]
}),
});
let resText = await response.text()
res.send(resText);
}
|