Recently, Digital Ocean announced they’re entering the PaaS market with their new application platform. They’ve hosted virtual machines (droplets) and Kubernetes based services for years, but now they’re creating a platform that’s a simple point and click to get an application up and running.
So I decided to try it. In this tutorial, we’re going to build an application on that platform. I will use Go to make a small web API and have it backed by a SQLite database. I’ll show you the steps required, and we’ll see just how easy it is (or isn’t) to deploy applications on the platform.
We’ll create a small service that:
If you want to follow along with this tutorial, here’s what you’ll need:
Computer with Go Installed
A Digital Ocean Account
- DB Browser for SQL Lite
The first thing we’ll need to do is create a repository on GitHub. The Digital Ocean app platform uses your repos to pull code from and builds from there.
Now, clone the Digital Ocean sample repository to another folder:
Now, you can fork this. However, since we’re not going to be contributing changes back to that repo, and we don’t want to pull changes from it, it’s essentially a new project. So I’m just going to copy the files from that repo into mine.
Now I have the sample code in my own repo:
Cool, now let’s push it up to Github.
git add .
git commmit -m "Initial Commit"
git push origin main
Now the sample project is available on my Github, where I can connect to it.
#programming #api #golang #golang-api #api-development #go #build-a-go-web-api #digital-ocean