Posted December 24, 2024Dec 24 Challenge: Create a RESTful API that serves inspirational quotes. The API should allow users to: Fetch a random quote Fetch a quote by ID 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: GET /quote/random - Returns a random quote. GET /quote/{id} - Returns a specific quote by ID. POST /quote - Adds a new quote (authenticated). 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.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.