bldg14 / eventual

A simple event calendar
https://eventual-client.fly.dev
MIT License
0 stars 0 forks source link

Bootstrap a basic Go server with stubbed data #11

Closed kevinfalting closed 1 year ago

kevinfalting commented 1 year ago

Overview

This creates a basic Go server that returns some stubbed data when making a request to /api/v1/events.

Resolves: #4

Thought Process

I tried to use a domain-driven-design pattern for this first pass, which just returns stubbed data, but could just as easily be swapped out to work with any datastore.

The server is hardcoded to listen on :8080 for now. When we introduce more configuration, we'll make this value configurable as well.

Testing Steps

You can test that this builds and runs:

  1. go run ./cmd/eventual
  2. Then navigate to http://localhost:8080/api/v1/events or curl http://localhost:8080/api/v1/events and you should get back a json formatted array of event objects.

When I started to write some unit tests, I found that I was mostly just testing the mock implementation rather than the actual code itself, which doesn't have any business logic, yet.

Risks

Low risk, this is a stubbed implementation of the server, nothing ready to make live yet.