Move software files one directory up, Readme
This commit is contained in:
30
src/data/api/mainApi.ts
Normal file
30
src/data/api/mainApi.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import axios from "axios"
|
||||
|
||||
const BASE_URL = "http://localhost:3000/api"
|
||||
|
||||
/**
|
||||
* Fetch the current state of backend server
|
||||
*
|
||||
* @returns Response from server
|
||||
*/
|
||||
export function fetchServerState() {
|
||||
return axios.get(BASE_URL)
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the database (without exercise progress) to factory state
|
||||
*
|
||||
* @returns Response from server
|
||||
*/
|
||||
export function resetDatabase() {
|
||||
return axios.get(BASE_URL + "/resetdatabase")
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the exercise progress
|
||||
*
|
||||
* @returns Response from server
|
||||
*/
|
||||
export function resetExerciseProgress() {
|
||||
return axios.get(BASE_URL + "/resetExerciseProgress")
|
||||
}
|
||||
Reference in New Issue
Block a user