HaoBin Encyclopedia is an API that archieve all the fun facts of Lee Hao Bin
Run this code, in a console or from any site:
To GET all Hao Bin facts
fetch("https://haobin.herokuapp.com/api/facts")
.then(response => response.json())
.then(json => console.log(json));
To GET single Hao Bin fact
fetch("https://haobin.herokuapp.com/api/facts/:phraseId")
.then(response => response.json())
.then(json => console.log(json));
To create a new fact regarding Hao Bin
fetch("https://haobin.herokuapp.com/api/facts", {
method: "POST",
headers: {
"Content-type": "application/json",
},
// POST only content, author and token field
// phraseId will be generated automatically
// request token from the owner
body: JSON.stringify(facts),
})
.then(response => response.json())
.then(json => console.log(json));
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.