about summary refs log tree commit diff stats
path: root/subx_bare.md
diff options
context:
space:
mode:
Diffstat (limited to 'subx_bare.md')
0 files changed, 0 insertions, 0 deletions
son <ben@gbmor.dev> 2019-05-11 03:32:00 -0400 committer Ben Morrison <ben@gbmor.dev> 2019-05-11 03:32:00 -0400 skeleton handlers responding' href='/gbmor/getwtxt/commit/main.go?h=v0.4.8&id=d4c05d21a4de2fe8f492957b66f40aa5e6757dca'>d4c05d2 ^
893123c ^
d4c05d2 ^
893123c ^
b9d16fb ^
fb63b07 ^
b9d16fb ^
d4c05d2 ^




893123c ^
fb63b07 ^
893123c ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26




                  

                                     
                                

 

                     
             
                                               
 
                               
 
                                          




                                                                                                                                    
 
                                                                                 
 
package main

import (
	"log"
	"net/http"

	"github.com/gorilla/handlers"
	"github.com/gorilla/mux"
)

const getwtxt = "0.1"

func main() {
	log.Printf("getwtxt " + getwtxt + "\n")

	serv := mux.NewRouter()

	serv.HandleFunc("/", indexHandler)
	serv.HandleFunc("/{api:(?:api|api/)}", apiBaseHandler)
	serv.HandleFunc("/api/{format:(?:plain|plain/)}", apiFormatHandler)
	serv.HandleFunc("/api/{format:(?:plain)}/{endpoint:(?:mentions|mentions/|users|users/|tweets|tweets/)}", apiEndpointHandler)
	serv.HandleFunc("/api/{format:(?:plain)}/tags/{tags:[a-zA-Z0-9]+}", apiTagsHandler)
	serv.HandleFunc("/api/{format:(?:plain)}/{tagpathfixer:(?:tags|tags/)}", apiTagsBaseHandler)

	log.Fatalln(http.ListenAndServe(":8080", handlers.CompressHandler(serv)))
}