web-form

command module
v0.0.0-...-cf7257f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 8 Imported by: 0

README

Webform

This is an example of how a web form is implemented in Golang. This is a login application where the user enters the username and password for authentication. Once a user has been authenticated, the application will persists the session using JWT.

This application has the following functions:

  1. Reads a file from the filesystem and streams the static file content to the web as a web form for the user to log in.
  2. Handles the submitted form.
  3. Persists a JWT in a cookie when the user is authenticated successfully.
  4. Redirects the user to another static web page called welcome page, which is only accessible to authorized users. The application examines if a valid JWT is in the request.
  5. Disables browser caching on the welcome page.

Setup

  1. Run the server

    $ go run server.go
    
  2. Launch a web browser and navigate to http://localhost:8000.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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