Martini是一个功能强大的软件包,用于在Golang中快速编写模块化Web应用程序/服务。

下载

$ go get github.com/go-martini/martini

Demo

server.go

//server.go
package main import "github.com/go-martini/martini" func main() {
m := martini.Classic()
m.Get("/", func() string {
return "Hello world!"
})
m.Run()
}

启动一个HTTP server,监听3000端口。

编译和执行

$ go build server.go
$ ./server
[martini] listening on :3000 (development)
[martini] Started GET / for [::1]:57956
[martini] Completed 200 OK in 184.546µs

client请求

$ curl http://localhost:3000
Hello world!%

参考

github martini

最新文章

  1. linux 命令 ---- 同步当前服务器时间
  2. 建站随手记:installation python virtualenv mezzanine -1
  3. centos7 install 安装mysql
  4. Homework_4 四则运算 - C#版
  5. Java多线程系列--“基础篇”02之 常用的实现多线程的两种方式
  6. LoadRunner脚本
  7. Java 基本语法(1)
  8. Android应用增加计时器
  9. 我们一起学SASS
  10. 如何在安装程序中判断操作系统是否是64位 inno
  11. Python 获取Facebook用户的Friends的爱好中的Top10
  12. Codeforces Round #242 (Div. 2) <A-D>
  13. json数据的获取(网络摘抄)
  14. 转:web_url函数学习
  15. Tecplot: 多截面云图显示
  16. React-记connect的几种写法
  17. (6)sudo命令详解(每周一个linux命令系列)
  18. python中sorted和.sorted 、reversed和reverse的注意点
  19. 转载:官方Caffe-windows 配置与示例运行
  20. 模拟器集成3DTouch-b

热门文章

  1. Java实现将文件或者文件夹压缩成zip
  2. 雷林鹏分享:jQuery EasyUI 数据网格 - 启用行内编辑
  3. JS正则表达式分组模式
  4. 『TensorFlow』读书笔记_Inception_V3_下
  5. laravel框架实现数据的删除和修改
  6. mybatis_generator合并xml和Java
  7. Python Flask之留言板(无数据库)
  8. mysql5.5大数据量下表结构升级
  9. SQL的decode()函数
  10. python笔记17-全局变量、局部变量