Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andyatkinson/gournay
Gournay is a URL shrinker written in Go, for me to learn Go.
https://github.com/andyatkinson/gournay
go golang heroku postgres
Last synced: 13 days ago
JSON representation
Gournay is a URL shrinker written in Go, for me to learn Go.
- Host: GitHub
- URL: https://github.com/andyatkinson/gournay
- Owner: andyatkinson
- Created: 2014-05-09T03:56:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-20T17:26:03.000Z (about 9 years ago)
- Last Synced: 2024-10-10T03:41:28.502Z (about 1 month ago)
- Topics: go, golang, heroku, postgres
- Language: Go
- Homepage: http://gournay.herokuapp.com/
- Size: 3.51 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Gournay is a URL shrinker written in Go.
## Try it
[http://gournay.herokuapp.com/](http://gournay.herokuapp.com/)
### building locally
go build gournay.go
When pushing to heroku, the app is compiled. When adding new dependencies, remember to run `godep save`.
### running in development
# psql
create database gournay_development;
create table entries (
url varchar(255),
hash varchar(5)
);Local postgres connection string like this, for a database called `gournay_development`:
export DATABASE_URL="user=andy host=localhost dbname=gournay_development sslmode=disable"
./gournay
# port is 5000 by default### Heroku
Details on using the [Heroku buildpack](http://stackoverflow.com/a/16655766/126688).
* Create a heroku instance with the custom buildpack
* Enable the postgres addon with: `heroku addons:add heroku-postgresql`
* Heroku binds to a random port, can't hard-code the port. [details](http://stackoverflow.com/a/15693371/126688)
* connect to heroku psql and set up database: `heroku pg:psql`. Find out database name from connection string, and create the tables.### resources
* [go import path](http://blog.golang.org/organizing-go-code)
* http://golang.org/doc/articles/wiki/
* http://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku.html
* http://blog.zmxv.com/2011/09/go-template-examples.html
* https://code.google.com/p/go-wiki/wiki/SQLInterface
* https://github.com/mindreframer/golang-stuff/tree/master/github.com/VividCortex/go-database-sql-tutorial