Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

katatrina/snippetbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This application lets people paste and share snippets of text - a bit like Pastebin or GitHub's Gist. This project uses Session-Cookie Authentication.

Prerequisites

  • Go >= 1.20
  • PostgreSQL 15

Setups

  • Type go mod tidy to install all project dependencies.
  • Configure database source name and schema in files cmd/web/main.go and internal/db/migrations.
  • Type go run ./cmd/web to start application.
  • Optional: You can find shorter commands in Makefile.

Available routes

Method Pattern Handler Action
GET / home Display the home page
GET /snippet/view/:id viewSnippet Display a specific snippet
GET /snippet/create displayCreateSnippetForm Display a HTML form for creating a new snippet
POST /snippet/create doCreateSnippet Create a new snippet
GET /user/signup displaySignupPage Display a HTML form for signing up a new user
POST /user/signup doSignupUser Create a new user
GET /user/login displayLoginPage Display a HTML form for logging in a user
POST /user/login doLoginUser Authenticate and login the user
POST /user/logout doLogoutUser Logout the user
GET /static/*filepath http.FileServer Serve a specific static file
GET /account/view viewAccount View account's information for each user
GET /about about Display the about page

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published