Skip to content

hiiiide/vesper-martini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vesper-martini

go-martini/martini base web app

Requirements

  • go version >= go1.2
  • port 3000
  • MySQL version >= 5.5

Install

go get github.com/exelexe/vesper-martini

Routes

| uri           | detail            |
| ------------- | ----------------- |
| /hello        | print "hello"     |
| /user/:id     | find users.id     |

Used Package

go get github.com/go-martini/martini
go get github.com/codegangsta/martini-contrib/render
go get github.com/go-sql-driver/mysql
go get github.com/jinzhu/gorm

SQL

CREATE DATABASE `practice` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;

CREATE TABLE `users` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci',
	`created_by` INT(11) NULL DEFAULT NULL,
	`updated_by` INT(11) NULL DEFAULT NULL,
	`lock_version` INT(11) NOT NULL DEFAULT '0',
	`created_at` DATETIME NOT NULL,
	`updated_at` DATETIME NOT NULL,
	PRIMARY KEY (`id`)
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB;

insert into users values (null, "hoge-ほげ", 1, 1, 0, now(), now());

About

practice golang martini web app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages