Leet Code is an application designed to help software engineers study for common technical interview questions.
This API is deloyed to Heroku. The host name is https://leet-cards.herokuapp.com
This API was built in Node.js and TypeScript using the express framework. A PostgreSQL database is utilized.
- An API key is required, and is kept secret using dotenv
- Client requests are restricted to the front-end application with the use of cors
- Express Rate Limit is used to help protect against brute force/DDoS attacks
- Helmet is used to secure HTTP headers
- All GET requests should have the following headers:
{
"Content-Type": "application/json"
}
- All POST, PUT, and DELETE requests should have the following headers:
{
"Content-Type": "application/json",
"apiKey": "mySecret-NeverTelling-:p"
}
Description | Path | Method | Body Required for Request | Sample Successful Response |
Get all flash cards | /cards/ | GET | none | An array of all flash card objects |
Get a single flash card | /cards/:id | GET | none | A single flash card object |
Create a new flash card | /cards/ | POST | { question: "string", answer: "string", side: "string", categories: [ "string", ... ] } | A new flash card object |
Update an existing flash card | /cards/:id | PUT | { answer: "string" } | "The answer was updated!" |
Delete an existing flash card | /cards/:id | DELETE | none | "The card has been deleted!" |
{
"id": "number",
"question": "string",
"answer": "string",
"side": "string",
"categories": [
"string",
...
]
}
- Clone down this repository
git clone https://github.com/alexmkio/leet-cards-api
- CD into your local clone
cd leet-cards-api
- Install project dependencies
npm install
- Run
npm start
This application was built by Alex Kio; a Front End Engineering alum from the Turing School of Software and Design.