- This API provides funny sigma rules from memes.
- Use it for fun, remeber all the rules are from internet.
- Kindly don't take the rules seriously.
- NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule
//#### NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule
const URL = "http://sigmarule.herokuapp.com/sigmarule"
const getPosts = async () => {
const response = await fetch(URL);
if (!response.ok) {
throw new Error("Error in fetching JSON data, Contact subhranshuchoudhury");
}
const data = await response.json();
return data;
}
getPosts()
.then(mydata => {
getRule(mydata);
})
.catch(error => {
alert(error);
});
function getRule(Rules) {
console.log(Rules); //Rules[index].rule
}
//#### NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule
const URL = "http://sigmarule.herokuapp.com/sigmarule/random"
const getPosts = async () => {
const response = await fetch(URL);
if (!response.ok) {
throw new Error("Error in fetching JSON data, Contact subhranshuchoudhury");
}
const data = await response.json();
return data;
}
getPosts()
.then(mydata => {
getRule(mydata);
})
.catch(error => {
alert(error);
});
function getRule(Rules) {
console.log(Rules.rule)
}
NOTE: Use "http" protocol for no error. eg. http://sigmarule.herokuapp.com/sigmarule
Author: Subhranshu Choudhury