{"id":18557384,"url":"https://github.com/prestaul/stackr","last_synced_at":"2025-05-15T14:09:45.111Z","repository":{"id":13319893,"uuid":"16006605","full_name":"Prestaul/stackr","owner":"Prestaul","description":"A simple http module system for node.js applications.","archived":false,"fork":false,"pushed_at":"2014-01-21T21:36:12.000Z","size":152,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T14:09:26.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Prestaul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-17T17:31:27.000Z","updated_at":"2015-03-23T12:38:31.000Z","dependencies_parsed_at":"2022-09-11T22:50:56.495Z","dependency_job_id":null,"html_url":"https://github.com/Prestaul/stackr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prestaul%2Fstackr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prestaul%2Fstackr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prestaul%2Fstackr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prestaul%2Fstackr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Prestaul","download_url":"https://codeload.github.com/Prestaul/stackr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355299,"owners_count":22057354,"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":[],"created_at":"2024-11-06T21:35:26.484Z","updated_at":"2025-05-15T14:09:40.092Z","avatar_url":"https://github.com/Prestaul.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"stackr\n======\n\nA simple http module system for node.js applications, similar to [*connect*](https://github.com/senchalabs/connect), or the more basic [*stack*](https://github.com/creationix/stack).\n\nStackr does not supply any middleware, it just provides an easy interface for composing a middleware stack.\n\n\nBasic Usage\n-----------\nStackr can be required like any other node module:\n```js\nvar stackr = require('stackr');\n```\n\nYou can construct a stack by passing middleware to the `stackr` constructor as arguments:\n```js\nvar stack = stackr(\n    require('logger')(),\n    require('static')(root, mount)\n);\n```\n\n or by calling `use` on the stack:\n```js\nvar stack = stackr()\n    .use(require('logger')())\n    .use(require('static')(root, mount));\n```\n\n\nCreating a Server\n-----------------\nYour stack can be used to create an http server:\n```js\nrequire('http').createServer(stackr(\n    require('logger')(),\n    require('static')(root, mount)\n)).listen(1337);\n```\n\n\nUsing Substacks\n---------------\nSubstacks provide a simple way to compose more complex stacks:\n```js\nvar substack = stackr.substack(\n    require('logger')()\n);\n\nvar stack = stackr(\n    substack,\n    require('auth')()\n);\n\nsubstack.use(require('static')(root, mount));\n```\n\nIn the above example the execution order will be `logger`, `static`, then `auth` because the entire substack will execute before anything that follows it in the outer stack.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestaul%2Fstackr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprestaul%2Fstackr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprestaul%2Fstackr/lists"}