TungNT (Blue)

tungnt.blue@gmail.com

User Tools

Site Tools


development:goravel

This is an old revision of the document!


Goravel

https://www.goravel.dev/getting-started/installation.html

git clone https://github.com/goravel/goravel.git && rm -rf goravel/.git*
 
mv goravel goravel.example.com
 
cp .env.example .env
 
# Tải tất cả các dependencies được khai báo trong go.mod.
# Xóa các dependencies không cần thiết.
# Cập nhật file go.sum.
go mod tidy
 
go run . artisan key:generate
 
# You need to generate JWT Token if you use Authentication.
go run . artisan jwt:secret

$GOPATH, mặc định là ~/go/bin

Thêm Module

File go.mod:

module your_project_name
 
go 1.21
 
require (
    github.com/goravel/framework v1.0.0
)

Ví dụ: nếu github.com/goravel/framework chưa được khai báo, thêm nó vào require hoặc sử dụng lệnh sau để thêm module:

go get github.com/goravel/framework

Xóa và tải lại module

Xóa cache của Go:

go clean -modcache

Tải lại tất cả dependencies:

go mod tidy

Tải Air qua Go

go install github.com/cosmtrek/air@latest

Start HTTP Service

go run .

air

https://github.com/air-verse/air

go run .

~/go/bin/air -c .air.toml
development/goravel.1732703731.txt.gz · Last modified: 2024/11/27 10:35 by tungnt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki