Skip to content

igal-abachi-dev/Free-CSharp-Api

Repository files navigation

Free C# API Hosting

A .NET 8 Web API in C#, based on the Visual Studio Web API template (Weather Forecast).

Live URL: WeatherForecast API

Live URL: KeepAlive API

Prevent Spindown

Connect to UptimeRobot to avoid the 50-second delay on the first call. look at KeepAliveController.cs file

Deploying a C# Web API on Render.com Using Docker

Step 1: Create a Render Account

  1. Go to Render.com and sign up for a free account.
  2. After signing up, log in to your Render dashboard.

Step 2: Create a New Web Service

  1. In the Render dashboard, click on the "New" button and select "Web Service".
  2. Connect your GitHub repository containing your C# web API project to Render.

Step 3: Configure the Service

  1. Name: Give your service a name.
  2. Environment: Select Docker.
  3. Build Command: Leave this blank as the Dockerfile handles the build process.
  4. Start Command: Leave this blank as the Dockerfile specifies the ENTRYPOINT.
  5. Dockerfile Path: If your Dockerfile is in the root of the repository, leave this as Dockerfile.
  6. Docker Context Directory: If your Dockerfile is in the root, set this to /.

Step 4: Deploy

  1. Click on "Create Web Service".
  2. Render will start the build process, pulling the necessary images, building your project, and deploying the service.

Your web service should now be up and running on Render.com!

Hosting Guide for C# API and React Vite TS Website

Hosting C# API on Render.com

  1. Create a Render Account: Sign up at Render.com.
  2. Deploy Your API:
    • Connect your GitHub repository.
    • Configure the service to use Docker.
    • Deploy your application.
    • Use Supabase free Postgres DB with Npgsql.EntityFrameworkCore.PostgreSQL.
    • Use Auth0 for free JWT login.

Hosting React Vite TS Website on Vercel

  1. Create a Vercel Account: Sign up at Vercel.com.
  2. Deploy Your Website:
    • Connect your GitHub repository.
    • Configure the project settings.
    • Deploy your website.
  3. Overcome CORS with Serverless Functions:
    • Use Vercel's serverless functions to proxy API requests.
    • Handle CORS issues effectively.

Releases

No releases published

Packages

No packages published