aboutsummaryrefslogtreecommitdiff
path: root/tests/test.go
blob: d3f414c71f5b108c21edd1d3b9e66909c1d6ad3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main

import (
	"net/url"
	"sleepy"
)

type Bar struct {
	sleepy.BaseResource
}

func (b Bar) Get(values url.Values) (int, interface{}) {
	return 200, map[string]string{"hello": "goodbye"}
}

func main() {
	bar := new(Bar)

	var api = new(sleepy.Api)
	api.AddResource(bar, "/bar")
	api.Start(3000)
}
bgstack15