Compare commits

...

7 Commits

Author SHA1 Message Date
58df8350c0 prepend messages instead of append 2024-09-21 10:57:26 +02:00
e336d0955c Update README.md 2024-09-18 21:44:24 +00:00
d8ee53cf7a how does Docker work lol 2024-09-18 22:51:41 +02:00
f88f97bd0c revert 14fd9f55ce
revert Update Dockerfile
2024-09-18 20:32:51 +00:00
14fd9f55ce Update Dockerfile 2024-09-18 20:25:02 +00:00
7731b9ae50 YOLO Dockerfile to see if Coolify eats it 2024-09-18 22:17:25 +02:00
9512bd677d Boanerbook title 2024-09-18 21:59:20 +02:00
5 changed files with 35 additions and 5 deletions

30
Dockerfile Normal file
View File

@ -0,0 +1,30 @@
# Use the official Go 1.23 image as the build stage
FROM golang:1.23 as build
# Set the working directory to /app
WORKDIR /app
# Copy the Go mod files
COPY go.mod go.sum ./
# Download the dependencies
RUN go mod download
# Copy the application code
COPY . .
# Build the application
RUN go build -o main cmd/main.go
# Use the scratch image as the runtime stage
FROM scratch
# Copy the built application from the build stage
WORKDIR /app
COPY --from=build /app/main /app/
# Expose the port
EXPOSE 1337
# Run the command to start the application
CMD ["./main"]

View File

@ -1,6 +1,6 @@
[Boner site and guestbook](https://boner.be)
Implementation of boner.be website and guestbook with the meme stack of Go and HTMX
Implementation of boner.be website and guestbook with the meme stack of Go and HTMX and also Tailwind
`(_)_)::::::::::::::D~~~~`

View File

@ -59,8 +59,8 @@ func (d *Data) indexOf(id int) int {
func newData() Data {
return Data{
Entries: []Entry{
newEntry("John Smith", "Hello world"),
newEntry("Jane Doe", "This is a great guestbook"),
newEntry("Asshole", "Hey, this is SHIT!"),
newEntry("Not Bd", "Fist my ginger pubes, faghole"),
},
}
}
@ -109,7 +109,7 @@ func main() {
message := c.FormValue("message")
entry := newEntry(name, message)
page.Data.Entries = append(page.Data.Entries, entry)
page.Data.Entries = append([]Entry{entry}, page.Data.Entries...)
c.Render(200, "form", newFormData())
return c.Render(200, "oob-entry", entry)

BIN
tmp/main

Binary file not shown.

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/htmx.org/dist/htmx.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<title>Hacker Guestbook</title>
<title>Boanerbook</title>
<script>
tailwind.config = {
theme: {