[dependencies]
tide = "0.15"
tinytemplate = "1.1"
serde = "1.0"
[dependencies.async-std]
version = "1.6"
features = ["attributes"]
(jp)
tideを使ってhtmlファイルとしてResponseを作成するサンプル
(en)
Sample that make response as html file using tide.
- リポジトリのクローン / Clone this repository
git clone https://github.com/yusuke-ota/tide_html_server_sample.git
- 実行 / cargo run
cd tide_html_server_sample
cargo run
- サーバにアクセス / Access to this html server
# return string "hello"
curl http://localhost:8080/
# return static html file
curl http://localhost:8080/hello_html
# return html file generated by template engin
curl http://localhost:8080/html_template/[string]
# return static html file notice not found
curl http://localhost:8080/something