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
Markus Johansen 4ad4ce0a75 💥 Poste innmeldte feil til backend
Co-authored-by: Sindre Kjelsrud <sindre.kjelsrud@nav.no>
Co-authored-by: Amalie Mansåker <amalie.erdal.mansaker@nav.no>
2023-07-05 14:17:57 +02:00

13 lines
No EOL
340 B
TypeScript

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);
})
}