An open API service indexing awesome lists of open source software.

https://github.com/introvesia/go-chat-api

Chat API with Golang for Introvesia Workspace
https://github.com/introvesia/go-chat-api

Last synced: 8 months ago
JSON representation

Chat API with Golang for Introvesia Workspace

Awesome Lists containing this project

README

          

# go-chat-api

Chat API server with Golang for Introvesia Workspace

## Prerequisites

- Golang installed

## Preparation for migration tools

Install migration tools:

```bash
brew install golang-migrate
```

Create a new migration:

```bash
migrate create -ext sql -dir migrations -seq
```

## Migrate database

1. Uncomment this code at `main.go`
```go
libs.AutoMigrate()
```
2. Run the server

## Check the module is uninstalled

```bash
go list -m all | grep
```

## Uninstall the module

```bash
go mod tidy
```

## Hot reload

Install `air`:

```bash
go install github.com/air-verse/air@latest
```

Add this code after edit profile use command `nano ~/.bashrc`:

```bash
export PATH=$PATH:$(go env GOPATH)/bin
```

Run `main.go` with this command:

```bash
air
```