Skip to content

sgulics/go-chi-example

Repository files navigation

Golang Chi Web Application POC

Investigating using Chi to create a simple web application that supports the following:

  1. REST API
  2. Admin Front End
    1. HTML Templates with ability to change template without restarting
    2. FuncMaps
    3. Javascript/CSS with hot reloading
    4. Asset support (images, css, javascript)
    5. Login and Session Management
    6. Support for Flash messages

Build & Run

go run cmd/server/main.go

Server is running on http://localhost:3333

Routing

API

Monitor

Admin

In order to use the Admin front end you need to install webpack:

npm install

for development mode (start and leave running in another console) ./node_modules/.bin/webpack-dev-server --config webpack.config.js --hot --inline

Or for production mode ./node_modules/.bin/webpack --config webpack.config.js --bail

All assets are in the assets folder

All templates are in the templates

Please note the admin front end does not actually do anything useful, I just wanted get an understanding of how all of this works.

Go to http://localhost:3333/admin

When prompted to login, type in anything.

You should be can make changes to the HTML templates without restarting.

You can change the CSS and Javascript and if in development mode, the assets should hot reload

About

Example Application using Chi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published