Include markdown sample

Fix UI refresh problem
Enable invocation from portal
This commit is contained in:
Alex Ellis
2017-01-31 09:08:58 +00:00
parent c211ba0d07
commit 4e73f787da
11 changed files with 152 additions and 7 deletions

View File

@ -0,0 +1,16 @@
FROM alpine:latest
WORKDIR /root/
EXPOSE 8080
ENV http_proxy ""
ENV https_proxy ""
ADD https://github.com/alexellis/faas/releases/download/v0.3-alpha/fwatchdog /usr/bin
RUN chmod +x /usr/bin/fwatchdog
# COPY fwatchdog /usr/bin/
COPY app .
ENV fprocess="/root/app"
CMD ["fwatchdog"]

View File

@ -0,0 +1,10 @@
FROM golang:1.7.3
RUN mkdir -p /go/src/app
COPY handler.go /go/src/app
WORKDIR /go/src/app
RUN go get github.com/microcosm-cc/bluemonday && \
go get github.com/russross/blackfriday
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
CMD ["echo"]

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
#!/bin/sh
echo Building alexellis2/faas-markdownrender:build
docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \
-t alexellis2/faas-markdownrender . -f Dockerfile.build
docker create --name render_extract alexellis2/faas-markdownrender
docker cp render_extract:/go/src/app/app ./app
docker rm -f render_extract
echo Building alexellis2/faas-markdownrender:latest
docker build --no-cache -t alexellis2/faas-markdownrender:latest .

View File

@ -0,0 +1,17 @@
package main
import (
"fmt"
"io/ioutil"
"os"
"github.com/microcosm-cc/bluemonday"
"github.com/russross/blackfriday"
)
func main() {
input, _ := ioutil.ReadAll(os.Stdin)
unsafe := blackfriday.MarkdownCommon([]byte(input))
html := bluemonday.UGCPolicy().SanitizeBytes(unsafe)
fmt.Println(string(html))
}