redux-server-golang

command module
v0.0.0-...-5020d09 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 9 Imported by: 0

README

Redux Server written in Go

This is a tiny REST service managing counters. The counters are kept in memory, so they are reset every time you restart the service.

Each counter has

  • a unique index (a number greater or equal 0) and
  • a value.

You can either get or set a counter. But in any distributed environment, the latter would be bad practice. Use this only for setting values for presentation purposes. Usually, you would use the increment and decrement operations instead.

You can either get or set a counter. Of course, you shouldn't set any counter in a distributed environment. Instead, you should get it and then use the increment or decrement operations on it. For presentations, it is a reasonable choice to set some counters before showing anything to your audience.

Building and Running the Server

To build and run the app, you need to install the Gin Web Framework and its CORS middleware first.

To do so:

$ go get github.com/gin-gonic/gin
$ go get github.com/gin-contrib/cors
$ go run github.com/MichaelKaaden/redux-server-golang

Alternative and Corresponding Implementations

This is only one possible solution to this kind of problem.

There are some implementations of single-page applications using the services which are implemented in different programming languages and frameworks.

Here's the full picture.

Client-Side Implementations

Server-Side Implementations

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package counters handles HTTP requests regarding counters.
Package counters handles HTTP requests regarding counters.

Jump to

Keyboard shortcuts

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