Minimal-URL-Shortener

(β˜… 146)

An example web app based on the new feature in .NET 8 | minimal web API in ASP.NET 8

  • .gitignore
  • Dockerfile
  • LICENSE.md
  • minimal-apis.png
  • postman.png
  • README.md
  • url-shortener.gif

# Installation Guide

1. Get the code
git clone https://github.com/dotnet-labs/Minimal-URL-Shortener

Downloads the entire project code from GitHub to your computer.

cd Minimal-URL-Shortener

Moves into the project folder you just downloaded.

2. Docker

Easy Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker run -it mcr.microsoft.com/dotnet/sdk:6.0-alpine sh

Runs the built image as an actual container.

docker build -t url-shortener-net6 .

Builds a runnable image based on the Dockerfile.

docker run -it --rm -p 8080:80 url-shortener-net6

Runs the built image as an actual container.

βœ… Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

Pulled directly from this repo's README.

3. .NET

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • .NET SDK The SDK required for the dotnet command.
dotnet new web

Type this command into your terminal and run it.

docker run -it mcr.microsoft.com/dotnet/sdk:6.0-alpine sh

Runs the built image as an actual container.

/ # dotnet --info

Type this command into your terminal and run it.

/ # dotnet new web

Type this command into your terminal and run it.

βœ… After dotnet run, check the message or address shown in the terminal.

Pulled directly from this repo's README.

// repository documentation