💥 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>
This commit is contained in:
parent
e49bce0470
commit
4ad4ce0a75
5 changed files with 59 additions and 21 deletions
13
frontend/pages/api/http.ts
Normal file
13
frontend/pages/api/http.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
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);
|
||||
})
|
||||
}
|
Reference in a new issue