Skip to content

b-nova-openhub/static-page-forwarder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stapafor-header

gostapafor (go-static-page-forwarder)

GoDoc GitHub repo size GitHub contributors GitHub stars GitHub forks Twitter Follow

gostapafor is a tool that allows content maintainers to do expose and forward html pages to a set of other services.

More specifically, gostapafor is microservice written in Go that forwards html pages over a RESTful interface. It is operates on the principles of KISS and is best integrated in a JAMstack.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of go1.16.5
  • You have a Linux/Mac OS machine with working knowledge of the underlying filesystem and Go build process.

Installing gostapafor

If you want to try out on your local machine, you can simply install gostapafor system-wide with the following command:

$ ❯  go install -v ./...

Alternatively, you can build a binary and run that one with a configurable shell script. See how to build stapagen with the Makefile further down below (#Makefile).

Running gostapafor

To run gostapafor, follow these steps:

$ ❯  stapafor

If you have build stapagen with the Makefile, you can simply adjust the parameters in the shell script stapagen.sh and then launch the script.

$ ❯  ./stapafor.sh

This method is preferable as you're more flexible and don't have to retype the binary arguments everytime.

Reading gostapafor's API

Once gostapafor is running, it does clone the git repository, converts its markdown files to html pages and forwards them over a RESTful api. That api can be accessed over locally if the executable was run on your local machine (http://localhost:8080) or over a K8s service definition.

Makefile

There is a Makefile which automates the building process of the stapagen application. The Makefile has 6 build targets: test, vet, fmt, mod, build, run, install and all. It can simply be run as such:

$ ❯  make build

Dockerfile

There is also a Dockerfile by which one can containerize the stapagen application. The port that is being exposed is the default 8080.

Deployment to K8s

{coming soon}

Quick Deployment to DigitalOcean's Kubernetes

Deploy to DO

Contributing to gostapafor

To contribute to gostapafor, follow these steps:

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin <project_name>/<location>
  5. Create the pull request.

Alternatively see the GitHub documentation on creating a pull request .

Contributors

Thanks to the following people who have contributed to this project:

You might want to consider using something like the All Contributors specification and its emoji key.

Contact

If you want to contact me you can reach me at info@b-nova.com.

License

This project uses the following license: MIT License