Skip to content

souza-dan/lfd_title_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LFD Server

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.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/souza-dan/lfd_title_generator.git
    cd lfd_title_generator
  2. Create a virtual environment and activate it:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

  1. Run the server:

    python server.py
  2. The server will start on http://0.0.0.0:5000.

API Endpoints

GET /api/v1/hello

Returns a simple "hello world" message.

GET /api/v1/title

Generates a random title in the format "Title of Noun".

GET /api/v1/title2

Generates a random title in the format "Title of Noun and Noun".

POST /api/v1/shuffle

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"]

Configuration

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Generate titles for the Lasagna Futurists

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published