rust-server - 評価
評価スケール
基本評価 (100点満点)
| 項目 |
配点 |
評価基準 |
| コンパイル |
10点 |
エラーなし |
| HTTPパース |
25点 |
正確なパース |
| ルーティング |
20点 |
パス・メソッド対応 |
| レスポンス |
20点 |
正しいフォーマット |
| 静的ファイル |
15点 |
正しいContent-Type |
| 並行処理 |
10点 |
複数接続対応 |
ボーナス評価 (最大30点)
| 項目 |
配点 |
| Keep-Alive |
10点 |
| ミドルウェア |
10点 |
| WebSocket |
10点 |
課題の目的
学習目標
- リクエスト/レスポンス形式
- ヘッダーの役割 - TCP接続の管理
- バッファリング - スレッドプール
- 接続管理評価手順
1. 基本機能テスト
# サーバー起動
./rust-server &
# GET リクエスト
curl http://localhost:8080/
curl http://localhost:8080/api/data
# POST リクエスト
curl -X POST -d "test data" http://localhost:8080/api/submit
# 静的ファイル
curl http://localhost:8080/index.html
2. ヘッダーテスト
# Content-Type 確認
curl -I http://localhost:8080/style.css
# Content-Type: text/css
curl -I http://localhost:8080/api/data
# Content-Type: application/json
3. 並行接続テスト
# 複数同時接続
ab -n 1000 -c 10 http://localhost:8080/
減点対象
| 項目 |
減点 |
| 不正なHTTPレスポンス |
-15点 |
| 接続リーク |
-10点 |
| パースエラー未処理 |
-10点 |
| 404未実装 |
-5点 |
合格基準
- マンダトリーパート: 80点以上
- curl で基本機能が動作すること