mux-books

command module
v0.0.0-...-087e527 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Mux-books

This repo contains a simple API built with Golang's Mux HTTP multiplexer and a simple cloud instance of PostgreSQL with ElephantSQL service.

This API performs a REST API's CRUD operations for a "books" resource. The "GET", "PUT", and "DELETE" methods expect an ID parameter via URL query string.

The project structure is separated by its concerns; it uses a certain kind of MVC pattern for better scalability, as it was never intended for expected growth. It is a workshop project for learning Golang's HTTP handling.

Usage

Before installing dependencies, you should have created a .env file key the key value of ELEPHANTSQL_URL key for the PostgreSQL connection string

Once the dependencies are installed, just:

go run main.go

And that's it.

Dependencies

There are a lot of them:

  1. gorilla as a MUX router
  2. net/http as a request handler
  3. encoding/json for JSON encoding,
  4. reflect for type checking
  5. strconv for string-int conversion

Credits

David Lares S

License

MIT

Documentation

Overview

entry point

Directories

Path Synopsis
repository

Jump to

Keyboard shortcuts

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