File tree Expand file tree Collapse file tree 6 files changed +82
-0
lines changed Expand file tree Collapse file tree 6 files changed +82
-0
lines changed Original file line number Diff line number Diff line change 1+ # Pine Benchmarking Test
2+
3+ ## Test URLs
4+
5+ ### JSON
6+
7+ http://localhost:8080/json
8+
9+ ### PLAINTEXT
10+
11+ http://localhost:8080/plaintext
Original file line number Diff line number Diff line change 1+ {
2+ "framework" : " pine" ,
3+ "tests" : [
4+ {
5+ "default" : {
6+ "json_url" : " /json" ,
7+ "plaintext_url" : " /plaintext" ,
8+ "port" : 8080 ,
9+ "approach" : " Realistic" ,
10+ "classification" : " Micro" ,
11+ "database" : " None" ,
12+ "framework" : " Pine" ,
13+ "language" : " Go" ,
14+ "flavor" : " None" ,
15+ "orm" : " None" ,
16+ "platform" : " None" ,
17+ "webserver" : " None" ,
18+ "os" : " Linux" ,
19+ "database_os" : " Linux" ,
20+ "display_name" : " Pine" ,
21+ "notes" : " " ,
22+ "versus" : " go"
23+ }
24+ }
25+ ]
26+ }
Original file line number Diff line number Diff line change 1+ FROM docker.io/golang:1.23
2+
3+ COPY ./src /pine
4+ WORKDIR /pine
5+
6+ RUN go mod download
7+
8+ EXPOSE 8080
9+
10+ CMD go run .
Original file line number Diff line number Diff line change 1+ module pine
2+
3+ go 1.23.0
4+
5+ require github.com/BryanMwangi/pine v1.0.6
Original file line number Diff line number Diff line change 1+ github.com/BryanMwangi/pine v1.0.6 h1:35JN1FQkStoCikeVQJ2423mO5STLNEPkA/AgnjslAmg =
2+ github.com/BryanMwangi/pine v1.0.6 /go.mod h1:j6+gT+N2HeeJHc9Z60rUOnEmNC+s/Gdmh2e9oB/eScI =
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "log"
5+
6+ "github.com/BryanMwangi/pine"
7+ )
8+
9+ func plaintextHandler (c * pine.Ctx ) error {
10+ c .Set ("Server" , "Pine" )
11+ return c .SendString ("Hello, World!" )
12+ }
13+
14+ func jsonHandler (c * pine.Ctx ) error {
15+ c .Set ("Server" , "Pine" )
16+ return c .JSON (map [string ]string {
17+ "message" : "Hello, World!" ,
18+ })
19+ }
20+
21+ func main () {
22+ app := pine .New ()
23+ app .Get ("/plaintext" , plaintextHandler )
24+ app .Get ("/json" , jsonHandler )
25+
26+ // Start the server on port 3000
27+ log .Fatal (app .Start (":8080" ))
28+ }
You can’t perform that action at this time.
0 commit comments