All Templates / Starters

Go

Go

A simple 1.22 Golang REST API using julienschmidt/httprouter for routing

Deploy Go

railway-go-api

haydenlingle/railway-go-api

Just deployed

This is a simple Go api that has one existing endpoint: 'healthcheck'. This api uses julienschmidt/httprouter for routing since it's powerful and simple. You shouldn't need any other 3rd party libraries to get a production API up and running.

Start in the main.go file. Here the application is scaffolded.

The routes.go file defines routes. Here you can define routes accompanying HTTP methods (GET, PUT, PATCH, etc).

The nixpacks file is custom only because the defaults Railway uses assumes the file structure is flat. I prefer to have the files in cmd/api so I made updates to that.

Once you have the service live in Railway, click on it to see the url it's hosted at. It will take a few minutes on first build. Once you're at the URL, add /v1/healthcheck at the end. You should see a json response!


Template Content

Deploy Now

Details

hayden's Projects

Created on Mar 5, 2024

124 total projects

64 active projects

100% success on recent deploys

Go

Starters



More templates in this category

View Template
mellow-vue

mellow-vue

A full-stack Vue app with The Boring JavaScript Stack.


My Workspace

View Template
.NET8 Web API

.NET8 Web API

A basic ASP.NET Core Web API template (.NET 8)


Dango

View Template
Django Monolith

Django Monolith

A Django app connected to a Postgres database with Celery and Celery Beat.


Odogwu Machalla's Projects