Skip to content

salami-dev/JokesAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JokeAPI Project Readme

Overview

JokeAPI is a simple .NET 8.0 based CRUD Web API designed for managing and sharing jokes. Deployed as a containerized service in an Azure Linux App Service, it supports operations like fetching random jokes, managing categories, and voting on jokes.

Features

  • Retrieve a random joke or a random joke by category
  • Fetch all categories or all jokes within a category
  • Look up a joke by its ID
  • Add new categories or jokes
  • Associate existing jokes with additional categories
  • Vote on jokes (like/dislike)

Getting Started

Prerequisites

Setup

  1. Clone the repository:

    git clone https://github.com/your-repository/JokeAPI.git
  2. Navigate to the JokesAPI project directory:

    cd src/JokesAPI
  3. Restore dependencies:

    dotnet restore
  4. Configure the database connection:

    Update the connection string in appsettings.json for PostgreSQL. Ensure the database exists in PostgreSQL with the corresponding name.

  5. Apply database migrations:

    dotnet ef database update
  6. Build the Docker image:

    docker build -t jokeapi .
  7. Run the application:

    docker run -p 8080:8080 jokeapi

    The API will be accessible on http://localhost:8080.

Deploying to Azure

  1. Navigate to the terraform directory:

    cd infra/terraform
  2. Initialize Terraform:

    terraform init
  3. Create an execution plan:

    terraform plan
  4. Apply the plan to deploy to Azure:

    terraform apply

For detailed instructions on SSH access to your custom container, refer to the Azure documentation.

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published