gofiber / cli Goto Github PK
View Code? Open in Web Editor NEWFiber Command Line Interface
License: MIT License
Fiber Command Line Interface
License: MIT License
Issue description
I run go get -u github.com/gofiber/cli/fiber
, and then use fiber dev
in the zsh, but get the error "zsh: command not found: fiber".
How can I fix it?
Environment: macOS Monterey 12.1, go version go1.17.4 darwin/amd64.
Question description
I'm having trouble getting the hot reloading working with fiber dev
inside a docker container.
Here is my Dockerfile.
FROM golang:1.18-alpine as build
WORKDIR /go/src/api
RUN go install github.com/gofiber/cli/fiber@latest
COPY . .
RUN go mod download
CMD ["fiber", "dev"]
Here is my docker-compose file.
services:
db:
image: mongo:5.0.7
restart: always
ports:
- 27017:27017
volumes:
- mongodb:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_USERNAME:-root}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD:-password}
api:
depends_on:
- db
build:
context: ./api
target: build
restart: always
ports:
- 3000:3000
volumes:
- ./api:/app
volumes:
mongodb:
I do see the files being changed inside the container but I cannot get the fiber cli to restart the fiber. What I might be missing?
Thanks.
Is your feature request related to a problem?
Installing via the regular go get
option is deprecated and hard to setup, go recommends the use of go install
instead
Issue description
go version
go version go1.15 darwin/amd64
go get -u github.com/gofiber/cli/fiber
# github.com/containerd/console
../../../go/src/github.com/containerd/console/console_unix.go:31:37: undefined: unix.O_RDWR
../../../go/src/github.com/containerd/console/console_unix.go:31:49: undefined: unix.O_NOCTTY
../../../go/src/github.com/containerd/console/console_unix.go:31:63: undefined: unix.O_CLOEXEC
../../../go/src/github.com/containerd/console/console_unix.go:51:12: undefined: unix.Termios
../../../go/src/github.com/containerd/console/console_unix.go:85:32: undefined: unix.Termios
../../../go/src/github.com/containerd/console/tc_darwin.go:27:13: undefined: unix.TIOCGETA
../../../go/src/github.com/containerd/console/tc_darwin.go:28:13: undefined: unix.TIOCSETA
../../../go/src/github.com/containerd/console/tc_unix.go:25:27: undefined: unix.Termios
../../../go/src/github.com/containerd/console/tc_unix.go:34:27: undefined: unix.Termios
../../../go/src/github.com/containerd/console/tc_unix.go:81:18: undefined: unix.Termios
../../../go/src/github.com/containerd/console/console_unix.go:31:63: too many errors
Issue description
Installation will result in the following erorr message
# github.com/gofiber/cli/cmd/internal
go/src/github.com/gofiber/cli/cmd/internal/cmd.go:31:14: spinnerModel.Frames undefined (type spinner.Model has no field or method Frames)
go/src/github.com/gofiber/cli/cmd/internal/cmd.go:52:41: too many arguments in call to spinner.Tick
have (spinner.Model)
want ()
go/src/github.com/gofiber/cli/cmd/internal/cmd.go:52:41: cannot use spinner.Tick(t.spinnerModel) (type tea.Msg) as type tea.Cmd in argument to tea.Batch: need type assertion
go/src/github.com/gofiber/cli/cmd/internal/cmd.go:103:24: undefined: spinner.Update
go/src/github.com/gofiber/cli/cmd/internal/cmd.go:113:10: undefined: spinner.View
go/src/github.com/gofiber/cli/cmd/internal/task.go:23:14: spinnerModel.Frames undefined (type spinner.Model has no field or method Frames)
go/src/github.com/gofiber/cli/cmd/internal/task.go:40:18: too many arguments in call to spinner.Tick
have (spinner.Model)
want ()
go/src/github.com/gofiber/cli/cmd/internal/task.go:40:18: cannot use spinner.Tick(t.spinnerModel) (type tea.Msg) as type tea.Cmd in argument to tea.Batch: need type assertion
go/src/github.com/gofiber/cli/cmd/internal/task.go:61:25: undefined: spinner.Update
go/src/github.com/gofiber/cli/cmd/internal/task.go:73:10: undefined: spinner.View
go/src/github.com/gofiber/cli/cmd/internal/task.go:73:10: too many errors
System information
System: Pop Os 20.04
go version go1.15.4 linux/amd64
Is your feature request related to a problem?
No!
Describe the solution you'd like
Would like to run fiber dev
on a CLI tool.
Could add -a, --args
flag to specify the arguments to pass to exec.
I think it would be fairly simple to add, can create a pull request if need be.
Is your feature request related to a problem?
Yes, sometimes, we want to run some commands before restart the application again.
Describe the solution you'd like
Provide an option to put custom commands before restarting the application.
E. g. fiber dev --before-restart "swag init"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.