Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
invinoveritas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gbe
invinoveritas
Commits
2e4d8be4
Commit
2e4d8be4
authored
4 years ago
by
gbe
Browse files
Options
Downloads
Patches
Plain Diff
Add skeleton
parent
cd0223f1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
go.mod
+1
-1
1 addition, 1 deletion
go.mod
main.go
+43
-0
43 additions, 0 deletions
main.go
static/test.txt
+1
-0
1 addition, 0 deletions
static/test.txt
templates/index.tpl
+9
-0
9 additions, 0 deletions
templates/index.tpl
with
54 additions
and
1 deletion
go.mod
+
1
−
1
View file @
2e4d8be4
module
git.c3pb.de/gbe/invinoveritas
go 1.1
5
go 1.1
6
This diff is collapsed.
Click to expand it.
main.go
0 → 100644
+
43
−
0
View file @
2e4d8be4
package
main
import
(
"embed"
"html/template"
"log"
"net/http"
)
//go:embed templates/*.tpl
var
templateFS
embed
.
FS
var
templates
=
template
.
Must
(
template
.
ParseFS
(
templateFS
,
"templates/*.tpl"
))
//go:embed static/*
var
staticFS
embed
.
FS
func
main
()
{
http
.
Handle
(
"/static/"
,
http
.
FileServer
(
http
.
FS
(
staticFS
)))
http
.
HandleFunc
(
"/"
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
log
.
Println
(
"handling"
,
r
.
Method
,
r
.
URL
,
"from"
,
r
.
RemoteAddr
)
if
r
.
Method
==
"GET"
{
w
.
Header
()
.
Add
(
"content-type"
,
"text/html"
)
err
:=
templates
.
ExecuteTemplate
(
w
,
"index.tpl"
,
nil
)
if
err
!=
nil
{
log
.
Println
(
"can't execute index template:"
,
err
)
}
return
}
})
const
listenAddr
=
"127.0.0.1:7878"
log
.
Printf
(
"here we go, listening on http://%s"
,
listenAddr
)
err
:=
http
.
ListenAndServe
(
listenAddr
,
nil
)
if
err
!=
nil
{
log
.
Println
(
"http handler failed:"
,
err
)
}
}
This diff is collapsed.
Click to expand it.
static/test.txt
0 → 100644
+
1
−
0
View file @
2e4d8be4
Sun Apr 11 18:32:00 CES 2021
This diff is collapsed.
Click to expand it.
templates/index.tpl
0 → 100644
+
9
−
0
View file @
2e4d8be4
<!doctype html5>
<html>
<head>
<title>
In Vino Veritas
</title>
</head>
<body>
Here there be dragons.
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment