在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:pandeiro/boot-http开源软件地址:https://github.com/pandeiro/boot-http开源编程语言:Clojure 97.8%开源软件介绍:boot-httpA simple HTTP [pandeiro/boot-http "0.8.3"] ;; latest release Usage(The following examples assume you have boot installed and updated.) Command line, no setupThis serves the current directory at port 3000: boot -d pandeiro/boot-http serve -d . wait To inspect the meanings of the flags and other tasks, use boot's built-in documentation mechanism: boot -d pandeiro/boot-http -h # show all tasks on the classpath
boot -d pandeiro/boot-http serve -h # show serve's usage Within a projectIf you already have a You can use boot-http for three different use cases: 1. Serve classpath resourcesboot serve wait # or from REPL: (boot (serve) (wait)) 2. Serve files on chosen directoryboot serve -d target wait # or at the REPL: (boot (serve :dir "target") (wait)) That would serve the Instead of specifying a directory, you can also specify a ring handler: 3. Start server with given Ring handlerboot serve -H myapp.server/app -R wait # (boot (serve :handler 'myapp.server/app :reload true) (wait)) Note: boot-http will automatically wrap responses in middlewares to
add content type and charset (see ComposabilityYou may have noticed the What good is that? It means you can compose with other tasks. In boot-cljs-example, for example, boot serve watch speak reload cljs-repl cljs -usO none which is, again, the same as: (comp (serve)
(watch)
(speak)
(reload)
(cljs-repl)
(cljs :optimizations :none)) In that case, since Other options-p / --portUse a specific port. A value of boot -d pandeiro/boot-http serve -d . -p 8888 wait -k / --httpkitUse the HTTP Kit webserver instead of Jetty. boot -d pandeiro/boot-http serve -d . -k wait # uses httpkit -n / --nreplStart an nREPL server for access to the http server. Accepts
boot -d pandeiro/boot-http serve -d . -n "{:port 3001}" -i / --init and -c / --cleanupSetup and teardown functions to run. -s / --silentSilences all output. -R / --reloadWrap provided ring handler with ring-reload. -N / --not-foundUse the provided symbol's function to handle requests for results that are not found. boot serve -d target -N myapp.server/custom-not-found wait -S / --charsetCharset to use when serving resources or files. Defaults to UTF-8. -t / --sslServe over HTTPS (see API and RoadmapRight now that is about it. It basically blends the functionality of
Feel free to add issues or comment here if you have any ideas. AcknowledgementsThe boot guys basically wrote all of this or walked me through any parts I had to change. Thanks! LicenseCopyright © 2015 Murphy McMahon Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论