go-rest-api

module
v0.0.0-...-b69cb46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2021 License: Apache-2.0

README

go-rest-api

go-rest-api is a playground for me to explore how to write Go micro-services from scratch.

Installation

The project uses Go modules, so you'll need Go >= 1.11.

You'll also need SQLite.

git clone https://github.com/sophiabrandt/go-rest-api.git

Usage

  1. Migrate and seed the SQLite database.
go run ./cmd/admin -action="migrate"
go run ./cmd/admin -action="seed"

Or use Makefile:

make seed
  1. Run the server. Default port is 4000, you can change it via command line flag.
go run ./cmd/server
# or go run ./cmd/server -addr=":8000"

Or use Makefile:

make run

Example endpoints:

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Apache 2.0 License, see LICENSE.

Acknowledgments

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL