This project is a simple Node.js API that provides random quotes and quotes by character. It is built with TypeScript.
Make sure you have Node.js and npm installed on your machine.
- Clone the repository:
git clone https://github.com/Atnaize/cyclimse.git
cd cyclimse
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
- Start the server:
npm start
The server will be running at http://localhost:3000.
You can now make requests to the API using tools like curl, Postman, or any HTTP client.
GET /v1/random
: Get a random quote.GET /v1/random/{number}
: Get a specific number of random quotes.GET /v1/character/{character}/{number?}
: Get a specific number of quotes by a particular character. If thenumber
parameter is not provided, it defaults to 1.
The project includes a quotes.json file that stores information about quotes from different characters. The structure of each entry in the JSON array is as follows:
[
{
"timestamp": "0:00:03",
"character": "Première voix off",
"quote": "Attention, ce flim n'est pas un flim sur le cyclimse. Merci de votre compréhension."
},
{
"timestamp": "0:00:13",
"character": "Deuxième voix off",
"quote": "Entre l'Australia et la South América, dans l'océan South Pacific : l'atoll de Pom Pom Galli."
},
// ...
]
The characters.json file follows a simple JSON array format with character names:
[
"Bob",
"Callaghan",
// ...
]
Feel free to contribute to this project by opening issues or submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.