Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify start command #84

Open
Shivakishore14 opened this issue Feb 21, 2018 · 1 comment
Open

Simplify start command #84

Shivakishore14 opened this issue Feb 21, 2018 · 1 comment

Comments

@Shivakishore14
Copy link

Current way of starting dingo server.

$ cd $GOPATH/src/github.com/dingoblog/dingo
$ go run main.go --port 8000

This can be changed to something like

$ dingo serve --port 8000

If you feel this is good, Just let me know, I can crush a weekend or two and give a PR.

@bentranter
Copy link
Collaborator

Hey @Shivakishore14, thanks for the suggestion. I could see this being a nice feature to have for users who aren't as familiar with the Go toolchain. There're a few considerations though.

Right now, you can run go get -u github.com/dingoblog/dingo, which will download and install the package as well as the binary. Once you've got the binary, and assuming your $GOBIN folder is in your $GOPATH, you can start the site using dingo --port 8000, it just won't work anywhere that isn't $GOPATH/src/github.com/dingoblog/dingo as Dingo won't be able to find the views folder.

That being said, it would be possible to use something like packr to load the views into the binary itself, so when users go get the repo they could start the server from anywhere with the dingo command. If we're going to put in that much effort though, it might be worth using goreleaser to ship binaries on every release, and remove the dependency on Go altogether for anyone wanting to install the binary.

Also, if you've got a different idea for how to achieve the dingo serve --port 8000 command, let me know and I'd I will happily consider it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants