{"id":26119129,"url":"https://github.com/weavejester/lein-ring","last_synced_at":"2025-04-14T18:51:53.895Z","repository":{"id":47653741,"uuid":"1147858","full_name":"weavejester/lein-ring","owner":"weavejester","description":"Ring plugin for Leiningen","archived":false,"fork":false,"pushed_at":"2023-05-31T23:00:07.000Z","size":254,"stargazers_count":502,"open_issues_count":45,"forks_count":99,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-07T16:00:42.356Z","etag":null,"topics":["clojure","leiningen","ring","war"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weavejester.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.html","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-07T21:33:17.000Z","updated_at":"2025-03-30T15:19:45.000Z","dependencies_parsed_at":"2024-06-18T15:17:07.419Z","dependency_job_id":"1eee291e-8eaf-4a0e-82bb-52561f2c732d","html_url":"https://github.com/weavejester/lein-ring","commit_stats":{"total_commits":289,"total_committers":45,"mean_commits":"6.4222222222222225","dds":"0.40138408304498274","last_synced_commit":"48e03bf5b1977d756ff4a5bb3c8eaf5f64a21951"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Flein-ring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Flein-ring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Flein-ring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weavejester%2Flein-ring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weavejester","download_url":"https://codeload.github.com/weavejester/lein-ring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248941554,"owners_count":21186916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","leiningen","ring","war"],"created_at":"2025-03-10T12:15:36.622Z","updated_at":"2025-04-14T18:51:53.875Z","avatar_url":"https://github.com/weavejester.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lein-Ring\n\nLein-Ring is a [Leiningen][1] plugin that automates common [Ring][2]\ntasks.\n\nIt provides commands to start a development web server, and to turn a\nRing handler into a standard war file.\n\n[1]: https://github.com/technomancy/leiningen\n[2]: https://github.com/ring-clojure/ring\n\n\n## Install\n\nTo use Lein-Ring, add it as a plugin to your `project.clj` file or\nyour global profile:\n\n    :plugins [[lein-ring \"0.12.6\"]]\n\nThen add a new `:ring` key to your `project.clj` file that contains a\nmap of configuration options. At minimum there must be a `:handler`\nkey that references your Ring handler:\n\n    :ring {:handler hello-world.core/handler}\n\nWhen this is set, you can use Lein-Ring's commands.\n\n## General options\n\nAs well as the handler, you can specify several additional options via\nyour `project.clj` file:\n\n* `:init` -\n  A function to be called once before your handler starts. It should\n  take no arguments. If you've compiled your Ring application into a\n  war-file, this function will be called when your handler servlet is\n  first initialized.\n\n* `:destroy` -\n  A function called before your handler exits or is unloaded. It\n  should take no arguments. If your Ring application has been compiled\n  into a war-file, then this will be called when your handler servlet\n  is destroyed.\n\n* `:adapter` -\n  A map of options to be passed to the Ring adapter. This has no\n  effect if you're deploying your application as a war-file.\n\n* `:async?` -\n  If true, treat handler as an async handler. Default false.\n\n\n## Environment variables\n\nLein-Ring pays attention to several environment variables, including:\n\n* `PORT`    - the port the web server uses for HTTP\n* `SSLPORT` - the port the web server uses for HTTPS\n\nThese will override any options specified in the `project.clj` file,\nbut won't override any options specified at the command line.\n\n\n## Starting a web server\n\nThe following command will start a development web server, and opens a\nweb browser to the root page:\n\n    lein ring server\n\nIf the `LEIN_NO_DEV` environment variable is **not** set, the server\nwill monitor your source directory for file modifications, and any\naltered files will automatically be reloaded.\n\nBy default, this command attempts to find a free port, starting at\n3000, but you can specify your own port as an argument:\n\n    lein ring server 4000\n\nThe server-headless command works like the server command, except that\nit doesn't open a web browser:\n\n    lein ring server-headless\n\n    lein ring server-headless 4000\n\n\n## Web server options\n\nThe following options affect the behavior of the web server started by\n`lein ring server`:\n\n* `:port` - The server port or port range\n\n* `:stacktraces?` -\n  If true, display a stacktrace when an exception is thrown.\n  Defaults to true for server or server-headless tasks. Ignored\n  (always false) for generated artifacts.\n\n* `:stacktrace-middleware` -\n  A symbol referencing the middleware to use for reporting\n  errors. Defaults to `ring.middleware.stacktrace/wrap-stacktrace`.\n\n* `:auto-reload?` -\n  If true, automatically reload modified source files. Defaults to\n  true for server or server-headless tasks. Ignored (always false) for\n  generated artifacts.\n\n* `:reload-paths` -\n  A collection of directory paths that can trigger a reload. By\n  default this takes all directories in the project classpath.\n\n* `:auto-refresh?` -\n  If true, automatically refresh the browser when files are modified.\n  Defaults to false. Ignored (always false) for generated artifacts.\n\n* `:refresh-paths` -\n  A collection of directory paths that can trigger a refresh.\n  Defaults to monitoring the `src` and `resources` directories.\n\n* `:nrepl` -\n  A map of `:start?` and (optionally) `:port` and `:host` keys. If\n  `:start?` is true, open up an nREPL server on the given\n  port. `:start?` defaults to false, `:port` defaults to an arbitrary\n  free port, and `:host` defaults to `\"localhost\"`.  __NOTE: This\n  option is only for development with the `lein ring server` task.\n  Setting this option will not cause a generated uberjar/uberwar to\n  run an nREPL server.  If you would like to run an nREPL server in\n  your production app, then see the clojure.tools.nrepl.server\n  project.__\n\n## Executable jar files\n\nLein-Ring can generate executable jar files for deployment purposes:\n\n    lein ring uberjar\n\nThis generates a jar file with all dependencies. You can then copy the\nfile to your web server and execute it with:\n\n    java -jar \u003cproject\u003e-\u003cversion\u003e-standalone.jar\n\n\n## War files\n\n### Compiling\n\nLein-Ring can generate war files that can be loaded onto legacy Java\nweb services such as Apache Tomcat:\n\n    lein ring war\n\nA servlet class and web.xml file will be generated automatically, and\nyour application packaged up in a war file.\n\nLike the `lein jar` command, you can specify the filename being\ngenerated as an additional option:\n\n    lein ring war my-app.war\n\nAlso provided is a `lein ring uberwar` command, which packages up all\nthe dependencies into the war:\n\n    lein ring uberwar\n\nThe following war-specific options are supported:\n\n* `:war-exclusions` -\n  A list of regular expressions for excluding files from the target\n  war. Defaults to excluding hidden files.\n\n* `:servlet-class` -\n  The servlet class name.\n\n* `:servlet-name` -\n  The name of the servlet (in web.xml). Defaults to the handler name.\n\n* `:url-pattern` -\n  The url pattern of the servlet mapping (in web.xml). Defaults to \"/*\".\n\n* `:servlet-path-info?` -\n  If true, a `:path-info` key is added to the request map. Defaults to true.\n\n* `:listener-class` -\n  Class used for servlet init/destroy functions. Called listener\n  because underneath it uses a ServletContextListener.\n\n* `:web-xml` -\n  web.xml file to use in place of auto-generated version (relative to project root).\n\n* `:servlet-version` -\n  The version of the servlet spec that we claim to conform\n  to. Attributes corresponding to this version will be added to the\n  web-app element of the web.xml. If not specified, defaults to 2.5.\n\n* `:uberwar-name` -\n  The name of the file generated by lein ring uberwar.\n\n* `:exploded` - \n  If true, will generate an exploded war directory instead of a war \n  file. If not specified, defaults to false.\n\nThese keys should be placed under the `:ring` key in `project.clj`,\nand are optional values. If not supplied, default values will be used instead.\n\n### Resources\n\nA war file can also include additional resource files, such as images or\nstylesheets. These should be placed in the directory specified by the\nLeiningen `:resources-path` key, which defaults to \"resources\". These\nresources will be placed on the classpath. To include multiple directories,\nuse the Leiningen `:resource-paths` key, which should be a vector. The\nvalues in `:resources-path` and `:resource-paths` will be concatenated.\n\nHowever, there is another sort of resource, one accessed through the\n`ServletContext` object. These resources are usually not on the classpath,\nand are instead placed in the root of the war file. If you happen to need this\nfunctionality, you can place your files in the directory specified by the\n`:war-resources-path` key (within the project map, rather than the map \nspecified by `:ring`), which defaults to \"war-resources\". (As with\nnormal resources, here you can use `:war-resource-paths` to include multiple\ndirectories.) It's recommended that you only use WAR resources for\ncompatibility with legacy Java interfaces; under most circumstances, you\nshould use the normal `:resources-path` instead.\n\n## License\n\nCopyright © 2015 James Reeves, Michael Blume\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavejester%2Flein-ring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweavejester%2Flein-ring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweavejester%2Flein-ring/lists"}