Commit 64b76690 authored by Artemis's avatar Artemis

Removing docker for now, Fixed form to validate that it's a string

parent 3cf81fa1
FROM golang:1.11-alpine
ADD ./ /app
WORKDIR /app
ENV GOPATH /tmp
ENV GOBIN /usr/bin
RUN apk update --no-cache && \
apk add git && \
go get && \
go build && \
apk del git && \
rm -rf $GOPATH
EXPOSE 1234
CMD ["/usr/bin/paste"]
version: "3"
services:
redis:
image: redis:alpine
ports:
- 6379
networks:
- app
paste:
build:
context: .
dockerfile: Dockerfile
networks:
- app
ports:
- "1234:1234"
environment:
- "REDIS_ADDR=redis:6379"
networks:
app:
......@@ -97,7 +97,7 @@ func main() {
}
pasteValue := req.Form["paste"][0]
if len(pasteValue) == 0 {
if pasteValue == "" {
// Required value
w.WriteHeader(400)
_ = t.homepage.Execute(w, &Content{Error: "You must provide a value", Value: pasteValue})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment