Initial commit
This commit is contained in:
17
.idea/MusicServer.iml
generated
Normal file
17
.idea/MusicServer.iml
generated
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="Go" enabled="true">
|
||||||
|
<buildTags>
|
||||||
|
<option name="customFlags">
|
||||||
|
<array>
|
||||||
|
<option value="appengine" />
|
||||||
|
</array>
|
||||||
|
</option>
|
||||||
|
</buildTags>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/MusicServer.iml" filepath="$PROJECT_DIR$/.idea/MusicServer.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
57
.idea/workspace.xml
generated
Normal file
57
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="d639f8a9-4b6d-4957-9ba4-8361acac15ca" name="Default Changelist" comment="" />
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="GOROOT" path="/usr/local/Cellar/go/1.15.2/libexec" />
|
||||||
|
<component name="ProjectId" id="1ipVJv6kTmBdByNysh6NxmS21gD" />
|
||||||
|
<component name="ProjectViewState">
|
||||||
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
|
<option name="showLibraryContents" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent">
|
||||||
|
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
||||||
|
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||||
|
<property name="go.import.settings.migrated" value="true" />
|
||||||
|
<property name="last_opened_file_path" value="$USER_HOME$" />
|
||||||
|
<property name="restartRequiresConfirmation" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="RunManager">
|
||||||
|
<configuration name="App Engine" type="GoApplicationRunConfiguration" factoryName="Go Application">
|
||||||
|
<module name="MusicServer" />
|
||||||
|
<working_directory value="$PROJECT_DIR$" />
|
||||||
|
<go_parameters value="-i" />
|
||||||
|
<kind value="PACKAGE" />
|
||||||
|
<filePath value="$PROJECT_DIR$" />
|
||||||
|
<package value="MusicServer" />
|
||||||
|
<directory value="$PROJECT_DIR$" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||||
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
|
<option name="version" value="3" />
|
||||||
|
</component>
|
||||||
|
<component name="WindowStateProjectService">
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.bottom" timestamp="1602604775177">
|
||||||
|
<screen x="0" y="0" width="1280" height="800" />
|
||||||
|
</state>
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.bottom/0.0.1280.800@0.0.1280.800" timestamp="1602604775177" />
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.center" timestamp="1602604775176">
|
||||||
|
<screen x="0" y="0" width="1280" height="800" />
|
||||||
|
</state>
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.center/0.0.1280.800@0.0.1280.800" timestamp="1602604775176" />
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.left" timestamp="1602604775175">
|
||||||
|
<screen x="0" y="0" width="1280" height="800" />
|
||||||
|
</state>
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.left/0.0.1280.800@0.0.1280.800" timestamp="1602604775175" />
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.right" timestamp="1602604775177">
|
||||||
|
<screen x="0" y="0" width="1280" height="800" />
|
||||||
|
</state>
|
||||||
|
<state width="1238" height="212" key="GridCell.Tab.0.right/0.0.1280.800@0.0.1280.800" timestamp="1602604775177" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
8
app.yaml
Normal file
8
app.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
application: musicserver
|
||||||
|
version: 1
|
||||||
|
runtime: go115
|
||||||
|
api_version: go1
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- url: /.*
|
||||||
|
script: _go_app
|
||||||
39
musicserver.go
Normal file
39
musicserver.go
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", indexHandler)
|
||||||
|
port := os.Getenv("PORT")
|
||||||
|
if port == "" {
|
||||||
|
port = "8080"
|
||||||
|
log.Printf("Defaulting to port %s", port)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("Listening on port %s", port)
|
||||||
|
log.Printf("Open http://localhost:%s in the browser", port)
|
||||||
|
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
|
||||||
|
}
|
||||||
|
|
||||||
|
func indexHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.URL.Path == "/test" {
|
||||||
|
_, err := fmt.Fprint(w, "Testing path")
|
||||||
|
if err != nil {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
} else if r.URL.Path == "/" {
|
||||||
|
_, err := fmt.Fprint(w, "Hello, World!!")
|
||||||
|
if err != nil {
|
||||||
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
http.NotFound(w, r)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user