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