Skip to content

saadfrhan/fastapi-poetry-helloworld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Greeting API

Welcome to the Greeting API! This is a simple FastAPI (with Poetry) project that offers a friendly greeting message. The API has three endpoints: a homepage greeting, a morning greeting, and a night-time message.

Description

This API offers three endpoints:

  1. /: A Greeting welcome message to greet you when you visit the homepage.
  2. /morning: A cheerful morning greeting to start your day with positivity.
  3. /night: A soothing night-time message to wish you sweet dreams.

Installation

To install and run this API locally, follow these steps:

  1. Clone this repository to your local machine:
git clone https://github.com/saadfrhan/fastapi-poetry-helloworld
  1. Navigate to the project directory:
cd fastapi-poetry-helloworld
  1. Install the dependencies using poetry:
poetry install
  1. Activate Poetry virtual environment:
poetry shell
  1. Adjust active python interpreter from your code editor settings (if needed). Set that Python interpreter as active which shows the virtual environment name in between.

  2. Run test files:

poetry run pytest -v
  1. Run the FastAPI server:
poetry run uvicorn fastapi_poetry_helloworld.main:app --reload
  1. You're all set! 🎉 The API should now be running locally at http://127.0.0.1:8000.

Documentation

Usage

Once the API is running, you can interact with it using your preferred API client or web browser. Here are some example requests:

  • Visit http://127.0.0.1:8000/ to see the Greeting welcome message.
  • Visit http://127.0.0.1:8000/morning to receive a cheerful morning greeting.
  • Visit http://127.0.0.1:8000/night to receive a soothing night-time message.

Feel free to explore and enjoy the friendliness of this API! If you have any questions or feedback, don't hesitate to reach out.

🤝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Star the project if you like it.

  • Fork the Project
  • Create your Feature Branch (git checkout -b feature/AmazingFeature)
  • Commit your Changes (git commit -m 'Add some AmazingFeature')
  • Push to the Branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

About

Simple Greeting API using FastAPI, Uvicorn, and Poetry

Topics

Resources

Stars

Watchers

Forks

Languages