A micro service that will deliver random nature quotes, or quotes based on select vibes The developer can specify between different feelings of quotes by supplying the right path to get a random quote of that vibe.
- Node
- Express: user needs to run 'npm express'
First the user needs run the server by putting 'run quotes.js' in terminal
- make a GET request using the URL: 'http://localhost:3001/quotesRandom'
- make a GET request using the URL: 'http://localhost:3001/quotes/{category}
- The List of categories are:
- inspirational
- peaceful
- reflective
- adventurous
- contemplative
fetch('http://localhost:3001/quotesRandom', {
method: 'GET',
headers: {
'Content-Type: 'application/json',
}
})
.then(response => response.json())
.then(data => {
const quote = data.quote;
console.log("Random Quote:", quote);
});
fetch('http://localhost:3001/quotes/adventurous', {
method: 'GET',
headers: {
'Content-Type: 'application/json',
}
})
.then(response => response.json())
.then(data => {
const quote = data.quote;
console.log("Adventurous Quote:", quote);
});
