A Free REST API for Shrek
Welcome to shREST, a Shrek-themed REST API for developers to learn and have fun with. Whether you're looking for fun Shrek-related data or just exploring APIs, this project has something for you! This project is for educational purposes only!
- Shrek-themed API
- Built with TypeScript and Cloudflare Workers
- Easily deployable using GitHub Actions and Wrangler.
curl https://shrekofficial.com/quotes/random
- Node.js (v16 or higher)
- npm (comes with Node.js)
- Wrangler CLI
- Clone the repository:
git clone https://github.com/annaelizabeth2019/shREST.git cd shREST npm i
Here is the list of available routes for shREST:
GET /
- Description: Returns the HTML homepage.
- Response: An HTML page describing the API.
GET /quotes/random
- Description: Fetches a random quote from a random Shrek movie.
- Response Example:
"Shrek: Better out than in, I always say."
GET /movies
- Description: Returns a list of all Shrek movies with brief attributes.
- Response Example:
[ { "name": "Shrek", "id": "shrek", "attributes": { "quotes_length": 10, "top_cast_length": 5, "year": 2001 } }, { "name": "Shrek 2", "id": "shrek2", "attributes": { "quotes_length": 15, "top_cast_length": 6, "year": 2004 } } ]
GET /:movieId
- Description: Returns detailed information about a specific movie.
- Response Example:
{ "movie": { "name": "Shrek", "id": "shrek", "quotes": ["Ogres are like onions.", "What are you doing in my swamp?"], // array of strings "top_cast": [], // see top cast response "year": 2001 } }
-
GET /:movieId/quotes/random
- Description: Fetches a random quote from the specified movie.
- Response Example:
"Shrek: This is the part where you run away." // string
-
GET /:movieId/quotes/random/text
- Description: Fetches a random quote as plain text from the specified movie.
- Response Example:
Donkey: I just know, before this is over, I'm gonna need a whole lot of serious therapy. Look at my eye twitchin'.
GET /:movieId/quotes
- Description: Returns all quotes from the specified movie.
- Response Example:
[ "Donkey: We can stay up late, swapping manly stories, and in the morning, I'm making waffles!", "Shrek: What are you doing in my swamp?" ]
GET /:movieId/cast/top
- Description: Returns the top cast members of the specified movie and the roles they played.
- Response Example:
[ { "name": "Mike Myers", "characters": [ "Shrek", "Blind Mouse", "Opening Narration" ] }, { "name": "Eddie Murphy", "characters": [ "Donkey" ] } ]
- Any Uncaught Error
- Response Example (500):
{ "error": "Internal Server Error", "message": "Error details..." }
- Response Example (500):
Feel free to test these routes with Postman or curl
!
No authorization required.
- TypeScript: A strongly-typed superset of JavaScript for building scalable and maintainable code.
- Hono: A lightweight and fast web framework optimized for Cloudflare Workers.
- Cloudflare Workers: A serverless platform to deploy globally distributed applications with low latency.
- Wrangler: A command-line tool for managing and deploying Cloudflare Workers.
- GitHub: Used for version control, collaboration, and automatic deployment via GitHub Actions.
- CSS: Custom styling is provided via static assets for a simple and clean UI.
- Global Availability: Powered by Cloudflare Workers
- Rapid Development: The use of TypeScript and Hono enables efficient and scalable development. Integration with Github actions provides fast deploy
- Fully Serverless: No server maintenance required, leveraging serverless architecture for cost efficiency and scalability.
Contributions to shREST are welcome and appreciated! Here's how you can contribute:
-
Fork the Repository
- Click the "Fork" button at the top of this repository to create your own copy.
-
Clone the Repository
- Clone your fork locally using:
git clone https://github.com/<your-username>/shREST.git cd shREST
- Clone your fork locally using:
-
Install Dependencies
- Install the required packages:
npm install
- Install the required packages:
-
Run the Development Server
- Start a local development server to test your changes:
npm run dev
- Start a local development server to test your changes:
-
Make Your Changes
- Add features, fix bugs, or enhance documentation!
-
Create a New Branch
- Use a descriptive branch name for your feature or fix:
git checkout -b feature/new-feature
- Use a descriptive branch name for your feature or fix:
-
Commit Your Changes
- Write clear and concise commit messages:
git add . git commit -m "Adds a new feature"
- Write clear and concise commit messages:
-
Push to Your Fork
- Push your changes to your forked repository:
git push origin feature/new-feature
- Push your changes to your forked repository:
-
Open a Pull Request
- Go to the original repository and open a pull request.
- Describe your changes and reference any related issues.
- Follow the existing code style and formatting.
- Include comments to explain complex logic or new features.
- Ensure your changes don’t break existing functionality.
If you find a bug or have a feature request, feel free to open an issue here.
Thank you for helping make shREST even better!
This project is licensed under the MIT License. You are free to use, modify, and distribute the code as per the terms of the license.
The Shrek-themed REST API includes quotes and references from the Shrek franchise. These materials are provided solely for educational and non-commercial purposes under the principles of fair use. This API is not affiliated with or endorsed by DreamWorks Animation or any related entities.
If you have any questions regarding the license or the use of the API, feel free to contact me directly.
If you have questions, feedback, or would like to connect, feel free to reach out!
- LinkedIn: Anna Peterson
- GitHub: annaelizabeth2019
- Aubrey McKinney - A big thanks to my friend Aubrey McKinney for his support and inspiration throughout this project.
- OpenAI's ChatGPT – For the assistance in planning, debugging, and crafting this project. I hate to admit it, but ChatGPT is fantastic at generating templates and boilerplate.
- IMDB - Really helped with finding Shrek Quotes.
- Shrek Fans Worldwide – shoutout to all the onions.