Mercurial > mercurial > hgweb_rsearcher.cgi
comparison go/server.go @ 13:f5ffc34f045a
manage DB.
author | pyon@macmini |
---|---|
date | Wed, 14 Nov 2018 19:43:40 +0900 |
parents | 240752cbe11b |
children | c1dc1fcee7fe |
comparison
equal
deleted
inserted
replaced
12:240752cbe11b | 13:f5ffc34f045a |
---|---|
1 /* | 1 /* |
2 server.go : server-program. | 2 server.go : server-program. |
3 Version : 1.3 | 3 Version : 1.3 |
4 Last Change: 2018-11-13 火 08:19:52. | 4 Last Change: 2018-11-14 水 17:03:30. |
5 | 5 |
6 install to: server_root/ | 6 install to: server_root/ |
7 | 7 |
8 server_root/server | 8 server_root/server |
9 + db/ | 9 + db/ |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 // start Web-server | 56 // start Web-server |
57 fmt.Println( "server start [", server, "] ( program version", version, ")" ) | 57 fmt.Println( "server start [", server, "] ( program version", version, ")" ) |
58 http.HandleFunc( "/", handler ) | 58 http.HandleFunc( "/", handler ) |
59 http.HandleFunc( "/upload", upload_handler ) | 59 http.HandleFunc( "/upload/", upload_handler ) |
60 http.HandleFunc( "/mngdb/", mngdb_handler ) | 60 http.HandleFunc( "/mngdb/", mngdb_handler ) |
61 log.Fatal( http.ListenAndServe( server, nil ) ) | 61 log.Fatal( http.ListenAndServe( server, nil ) ) |
62 } | 62 } |
63 | 63 |
64 func handler( w http.ResponseWriter, r *http.Request ) { | 64 func handler( w http.ResponseWriter, r *http.Request ) { |
65 file := filepath.Join( server_root, filepath.FromSlash( r.URL.Path ) ) | 65 file := filepath.Join( server_root, filepath.FromSlash( r.URL.Path ) ) |