This repository has been archived on 2024-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
helse-sprik/frontend/pages/api/http.ts

13 lines
340 B
TypeScript
Raw Normal View History

import axios from "axios";
export default function post(route: String, data?: Object) {
axios.post("http://0.0.0.0:8080/" + route, data, {
headers: {
'Content-Type': 'application/json'
}
}).then((response) => {
console.log(response)
}).catch((error) => {
console.log(error);
})
}