Example helloworld test web application
Last updated 2023-02-24
IMPORTANT
This guide only applies to Next-Gen WAF customers with access to the Next-Gen WAF control panel. If you have access to the Next-Gen WAF product in the Fastly control panel, you can only deploy the Next-Gen WAF with the Edge WAF deployment method.
This uses the helloworld
example included with the Next-Gen WAF Golang module as a test web application named helloworld
.
See main.go
in the sigsci-module-golang
helloworld
example.
Dockerfile
Dockerfile to build the signalsciences/example-helloworld
container:
$ docker build . -t signalsciences/example-helloworld:latest
12345678910111213
FROM golang:1.13
# Image metadataLABEL com.signalsciences.sigsci-module-golang.examples="helloworld"LABEL maintainer="Signal Sciences <support@fastly.com>"
# Install sigsci golang module (with examples)RUN go get github.com/signalsciences/sigsci-module-golang
# Use the helloworld example as the test appWORKDIR /go/src/github.com/signalsciences/sigsci-module-golang/examples
ENTRYPOINT [ "go", "run", "./helloworld" ]
Kubernetes deployment file
Kubernetes example-helloworld
deployment file (without the Next-Gen WAF agent):
$ kubectl apply -f example-helloworld.yaml
12345678910111213141516171819202122232425262728293031323334353637383940
apiVersion: v1kind: Servicemetadata: name: helloworld labels: app: helloworldspec: ports: - name: http port: 8000 targetPort: 8000 selector: app: helloworld type: LoadBalancer---apiVersion: apps/v1kind: Deploymentmetadata: name: helloworld labels: app: helloworldspec: replicas: 2 selector: matchLabels: app: helloworld template: metadata: labels: app: helloworld spec: containers: - name: helloworld image: signalsciences/example-helloworld:latest imagePullPolicy: IfNotPresent args: # Address for the app to listen on - localhost:8000 ports: - containerPort: 8000
Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.