Skip to content

Latest commit

 

History

History
69 lines (52 loc) · 1.64 KB

File metadata and controls

69 lines (52 loc) · 1.64 KB

REST API - Today's quote


Hosted by Netlify and using Express + Netlify-lambda functions + serverless-http, this API will return as response a different author-quote per day. Which quote you are going to get by default is defined by the current day (n° 1 to 31) of the month (ART time zone).

Total quotes: 31 (one per day) - available languages: English / Spanish


SAMPLE | Get today's quote

Request

https://eac-api-quote.netlify.com/.netlify/functions/api/quote

Response

"quote": {
            "en": {
                "author": "Jean-Paul Sartre",
                "text": "We are our choices"
            },
            "es": {
                "author": "Jean-Paul Sartre",
                "text": "Somos nuestras elecciones"
            }
        }

GET | Available options

Considering the following url https://eac-api-quote.netlify.com/ .netlify/functions/api/value-to-be-change

  1. Get today's quote (en/es)
    Request: api/quote
    
  2. Get today's quote only in English or Spanish language
    Request: api/quote/en
             api/quote/es
    
  3. Get all the quotes
    Request: api/quotes
    
  4. Get a random quote
    Request: api/quotes/random
    
  5. Get a random quote only in English or Spanish language
    Request: api/quotes/random/en
             api/quotes/random/es
    

Provides a quick 5' minutes explanation on how to deploy an express.js app on Netlify using the option Netlify functions.