Я пытаюсь настроить конечную точку REST в Go в рабочем пространстве Eclipse-Che
Мой код показан ниже:
package main
import (
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(http.ResponseWriter, *http.Request) {
log.Println("Hello world1")
})
http.HandleFunc("/goodbye", func(http.ResponseWriter, *http.Request) {
log.Println("Goodbye world")
})
http.ListenAndServe(":8085", nil)
}
Вкл. запуская мой код go, я получаю следующий вывод.
bash-4.4 /projects/src/github.com/golang $ curl -V 10.130.54.6/8084
curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2u zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
bash-4.4 /projects/src/github.com/golang $ curl -V http://10.130.54.6/8084
curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2u zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL