1
0
hugo/old/2016-08-01-swift-swiftra.md

20 lines
607 B
Markdown
Raw Permalink Normal View History

2024-04-23 13:21:26 +00:00
+++
date = "2016-08-01"
tags = ["memo"]
title = "swift-swiftra"
slug = "swift-swiftra"
+++
[swiftra](https://github.com/takebayashi/swiftra)というものがあります。名前からも分かるように[sinatra](http://www.sinatrarb.com/)をリスペクトして作成されているぽい。
```bash
$ git clone https://github.com/takebayashi/swiftra-example.git
$ cd swiftra-example
$ swift build
$ ./.build/debug/swiftra-example
$ curl 'http://localhost:8080/abc'
/abc was requested with GET
$ curl -X POST -d foo=bar 'http://localhost:8080/abc'
/abc was requested with POST, body = foo=bar
```