Jump to content

Recommended Posts

Posted

Challenge:
Create a RESTful API that serves inspirational quotes. The API should allow users to:

  1. Fetch a random quote
  2. Fetch a quote by ID
  3. Add a new quote

Requirements:

  • Use any programming language or framework (e.g., Python with Flask, Node.js with Express, etc.).
  • Store the quotes in a file (JSON, text, or CSV) or a database.
  • Return responses in JSON format.

Bonus Points:

  • Implement authentication for adding a new quote.
  • Include a search endpoint to find quotes by keyword.
  • Deploy your API using a lightweight server manager like PM2 or Docker.

Example Endpoints:

  1. GET /quote/random - Returns a random quote.
  2. GET /quote/{id} - Returns a specific quote by ID.
  3. POST /quote - Adds a new quote (authenticated).
  4. GET /quote/search?keyword={keyword} - Searches for quotes by keyword.

Sample Output:

{
  "id": 1,
  "quote": "The best way to predict the future is to invent it.",
  "author": "Alan Kay"
}

Rules:

  • Post your solution as a reply in the thread, linking to your repository (e.g., GitHub or GitLab).
  • Explain your implementation briefly.

You can see an example in my signature.

CodeName: Jessica

💻 Linux Enthusiast | 🌍 Adventurer | 🦄 Unicorn 
🌐 My Site | 📢 Join the Forum

spacer.png

 

  • Jessica Brown changed the title to Programming Challenge: Build a Simple Quote API (Dec 24, 2024)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.