LFD Server is a simple Flask-based web server that generates random titles and shuffles lists. It provides several API endpoints for generating titles and shuffling lists.
-
Clone the repository:
git clone https://github.com/souza-dan/lfd_title_generator.git cd lfd_title_generator
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the server:
python server.py
-
The server will start on
http://0.0.0.0:5000
.
Returns a simple "hello world" message.
Generates a random title in the format "Title of Noun".
Generates a random title in the format "Title of Noun and Noun".
Shuffles a list of items provided in the request.
-
Request Parameters:
list
(string): A comma-separated list of items to shuffle.separator
(string, optional): The separator to use in the response. Defaults to a comma.
-
Example Request:
curl -X POST -F "list=item1,item2,item3" -F "separator=," http://0.0.0.0:5000/api/v1/shuffle
-
Example Response:
["item3,item1,item2"]
The server uses two JSON files for generating titles and nouns:
titles.json
: Contains a list of titles.nouns.json
: Contains a list of nouns.
You can specify different files using the -t
and -n
command-line arguments when starting the server.
This project is licensed under the MIT License. See the LICENSE
file for details.