diff --git a/README.md b/README.md index 196de94..8da2f62 100644 --- a/README.md +++ b/README.md @@ -247,10 +247,6 @@ A convenience function for generating a response map. Responses are simply Cloju `(pcp/render-html options & content)` Renders html from Clojure data strucutures using [hiccup](https://github.com/weavejester/hiccup) -#### pcp/render-html-unescaped -`(pcp/render-html & args)` -Renders html from Clojure data strucutures using [hiccup](https://github.com/weavejester/hiccup). Does not escape html tags strings. Use with care. - #### pcp/secret `(pcp/secret "SECRET_NAME")` Retrieves secret from project. The secret is read from disk. It may be worthwhile using `pcp/persist` to improve performance. @@ -264,6 +260,12 @@ Returns the current time in milliseconds (according to your server). `(pcp/slurp "../file-name")` Opens a reader on f and reads all its contents, returning a string. Cannot access files higher up that project root (i.e. server root -1). Does not currently accept any optional arguments. +#### pcp/slurp-upload +`(pcp/slurp-upload "/var/tmp/temp-file-name")` +`(pcp/slurp-upload (-> pcp/request :params :uploaded :tempfile))` +Opens a reader on f and reads all its contents, returning a string. Cannot access files higher up that project root (i.e. server root -1). Does not currently accept any optional arguments. + + #### pcp/spit `(pcp/spit "../file-name" "like drugs but better")` Opposite of slurp. Opens f with writer, writes content, then closes f. Cannot access files higher up that project root (i.e. server root -1). Does not currently accept any optional arguments. diff --git a/src/pcp/core.clj b/src/pcp/core.clj index d23d455..1f7a749 100644 --- a/src/pcp/core.clj +++ b/src/pcp/core.clj @@ -197,7 +197,7 @@ ;; (pohjavirta/stop s)))) (defn serve [handler port] - (let [s (server/run-server handler {:port port})] + (let [s (server/run-server handler {:port port :max-body (* 100 1024 1024)})] (println "running...") (fn [] (s)))) diff --git a/src/pcp/utility.clj b/src/pcp/utility.clj index fd54a4d..41313f3 100644 --- a/src/pcp/utility.clj +++ b/src/pcp/utility.clj @@ -161,7 +161,8 @@ Options: project-name (do (print "Project name: ") (flush) (safe-trim (read-line))) _ (println)] (io/make-parents keypath) - (spit keypath (prn-str {:project project-name})))) + (spit keypath (prn-str {:project project-name})) + (Thread/sleep 1000))) (let [project (-> keypath slurp edn/read-string) _ (do (println "--------------------------------------------------")