I'm trying to display a static page with Go. Go: Package main import "net / http" function main () {fs: = http.FileServer (http.Dir ("static / house")) Http: .handle ("/", fs) http.ListenAndServe (": 4747", zero)} directory: project / stable home Html edit.html project.go When I run it, the web page displays links to edit.html and home.html instead of displaying a static page from home.html is. What am I doing wrong. Is this the best way to serve files? I know that there are other ways like From the HTML / templates package, but I'm not sure what is the difference between each of these methods and when. Thanks! fancy main () {http.Handle ("/", http.FileServer (Http) .ir ("static")) http.ListenAndServe (": 4747", zero)} You do not need static / home , just Static . and when you do not have index.html in / static , the directory instead Content appears. Just change the name of...
First of all, can anyone explain, what is the difference between the object node and the jesenand, and where did they use it? Then what can I do if I want to convert a JSON string to ObjectNode? You can: object mapper mapper = new object On mapper (); JsonNode realObj = mapper.valueToTree ("{\" k1 \ ": \" v1 \ "}") JsonNode is a super class of this object node. You can find differences in the API.
Comments
Post a Comment