add an additional .content file, see issue #23

This commit is contained in:
Gavin McCullagh 2021-03-21 07:56:49 +00:00
parent 52f31746ab
commit 2da4b179ae

13
main.go
View file

@ -37,6 +37,11 @@ const METADATA_TEMPLATE = `{
}
`
const CONTENT_TEMPLATE = `{
"fileType": "pdf"
}
`
func main() {
@ -171,5 +176,13 @@ func handleRequest(conn net.Conn) {
f.WriteString(fmt.Sprintf(METADATA_TEMPLATE, time.Now().Unix(), title))
f.Close()
// ----- Create .content -----
cont_path := XOCHITL_DIR + u.String() + ".content"
fmt.Println("Saving content file to", cont_path)
f, err = os.Create(cont_path)
f.WriteString(fmt.Sprintf(CONTENT_TEMPLATE))
f.Close()
conn.Close()
}