mirror of
https://github.com/adanrsantos/ThePlaceHolders.git
synced 2024-12-16 14:20:39 -06:00
Added go code
This commit is contained in:
parent
e9f29caa0d
commit
c4ab29f648
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module github.com/adanrsantos/ThePlaceHolders
|
||||
|
||||
go 1.23.1
|
31
server.go
Normal file
31
server.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const ADDRESS = "127.0.0.1"
|
||||
const PORT = "8080"
|
||||
|
||||
func get_canvas(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "test data")
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Host static files
|
||||
static_files := http.FileServer(http.Dir("static/"))
|
||||
http.Handle("/", static_files)
|
||||
|
||||
// Response generated by code
|
||||
http.HandleFunc("/get-canvas", get_canvas)
|
||||
|
||||
// Start web server at 127.0.0.1:8080
|
||||
e := http.ListenAndServe(ADDRESS+":"+PORT, nil)
|
||||
// Print any errors
|
||||
if e != nil {
|
||||
fmt.Println(e)
|
||||
} else {
|
||||
fmt.Println("Started server successfully")
|
||||
}
|
||||
}
|
7
static/bootstrap.bundle.min.js
vendored
7
static/bootstrap.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
6
static/bootstrap.min.css
vendored
6
static/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -5,9 +5,21 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>UTSA Placeholders</title>
|
||||
<link rel="stylesheet" href="/bootstrap.min.css">
|
||||
<script src="/bootstrap.bundle.min.js"/>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
Hello Placeholders
|
||||
</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/register.html"> Register </a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/login.html"> Login </a>
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>UTSA Placeholders</title>
|
||||
<link rel="stylesheet" href="/bootstrap.min.css">
|
||||
<script src="/bootstrap.bundle.min.js"/>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>UTSA Placeholders</title>
|
||||
<link rel="stylesheet" href="/bootstrap.min.css">
|
||||
<script src="/bootstrap.bundle.min.js"/>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
|
|
Loading…
Reference in a new issue