All Templates / Starters
Go
A simple 1.22 Golang REST API using julienschmidt/httprouter for routing
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
railway-go-api
haydenlingle/railway-go-apiDetails
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
Django Monolith
A Django app connected to a Postgres database with Celery and Celery Beat.
Odogwu Machalla's Projects
37