saiumesh535 / chi-http

Chi-http example for golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chi-http

Chi-http example for golang

Chi is great library for creating HTTP services and it has easy routing system.

Motivation

When I started learning golang, it was little difficult to find basic examples. This repository will try to address some problems that I encountered while learning golang.

This Repository will have basic examples to implement your APIs.

Installation

For installing all the dependencies run go get -d ./...

This project didn't update with go mods.

start server

You can start server by running command go run main.go

if you want to restart server on file change follow below steps

  1. Install realize by running go get github.com/oxequa/realize

  2. start server by realize start

Table of Contents

  • main.go main.go file which bootstrap our project

  • database/connectdb MongoDB connection example

  • Auth Folder contains login and sign up examples and also router Mount example.

  • download Folder contains Downloading files from golang server example

  • static Folder contains example for serving static file to browser such as html/css

  • upload contains example for uploading files using golang

  • Private Creating private routes for APIS, which requires JWT token

some helpful resources for learning

Since working with JSON in golang is pretty confusing for many people, so making some of the good resources below.

write your own middlewares

https://justinas.org/writing-http-middleware-in-go

About

Chi-http example for golang


Languages

Language:Go 93.3%Language:HTML 6.7%