{"_id":"titan","_rev":"88-3d2088529cd7f4c060d833bc46f0881e","name":"titan","description":"A stellar API framework built on top of Argo.","dist-tags":{"latest":"1.3.0"},"versions":{"0.0.6":{"name":"titan","version":"0.0.6","description":"A stellar API framework.","main":"resource.js","directories":{"example":"example"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["argo","resource","rest","framework","api"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","dependencies":{"negotiator":"~0.2.7","pipeworks":"~1.2.0"},"_id":"titan@0.0.6","dist":{"shasum":"6986d6c61a38faf91a56b2edf45eee9b7ee03992","tarball":"https://registry.npmjs.org/titan/-/titan-0.0.6.tgz","integrity":"sha512-dY5Z9C1SU2/bkjFguIN1SA8Prmj9ngG/zEiWnDuvyr7FedoKwWKEQ5+h40UMG+XQ+fCADu6PqXd4I9SJ1qzfYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPCxb+jzFdNgQkokonDabO0lgMrmI9goR+g58WKf9h6QIgKdKpveOga4jXnhqckhmPP3ntw5nWGGkMg+RRbzQsqp4="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"kevinswiber","email":"kswiber@gmail.com"},"maintainers":[{"name":"kevinswiber","email":"kswiber@gmail.com"}]},"0.0.0":{"name":"titan","version":"0.0.0","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":"0.0.0"},"_id":"titan@0.0.0","dist":{"shasum":"bdfaf5ca11aba2f8f07d9471f0bd04e241f7d9d6","tarball":"https://registry.npmjs.org/titan/-/titan-0.0.0.tgz","integrity":"sha512-UEdu9yiUzLvQEOQQ3yzAM60lk3zPSd+rwLZAU30u3ljkzKQEptdBRAzYctgValifR1GfdWolkkpPB9ZSpWtexA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClMqLr2EBsq2ae4kXCDONFUDzAqe4gfTCXBBdXbs6RSQIhAP04piDNcu63BtXTzhUyMSeWEgYSj0GTw3Bc/pDf54fq"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"kevinswiber","email":"kswiber@gmail.com"},"maintainers":[{"name":"kevinswiber","email":"kswiber@gmail.com"}],"directories":{}},"0.1.0":{"name":"titan","version":"0.1.0","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":"0.0.0"},"_id":"titan@0.1.0","dist":{"shasum":"88152e5463fd28c2f2689051d20f88e5d805ae31","tarball":"https://registry.npmjs.org/titan/-/titan-0.1.0.tgz","integrity":"sha512-sT2fjJXnzeyAiy48zRPqHoFZ030buZCfDcNrUGQW2oqolbC9NM4z1wvW7qFajJc8Eb7MJyvvoi+WWDq+/P+RQw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDojlR6eppy8v9PeCRwPVOzcfCD3uLhmQyghKk7f6Gs3wIgEEbw6Kb+zyqggFhMlSrCMzkZuVKRh+BT+wlMEhDgmLs="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"kevinswiber","email":"kswiber@gmail.com"},"maintainers":[{"name":"kevinswiber","email":"kswiber@gmail.com"}],"directories":{}},"0.1.1":{"name":"titan","version":"0.1.1","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":"0.0.0"},"_id":"titan@0.1.1","dist":{"shasum":"d1e1001c2fd3c67618a270ecceb8bfd007e80bba","tarball":"https://registry.npmjs.org/titan/-/titan-0.1.1.tgz","integrity":"sha512-uBR9WGuFBRNxtvWH0Flera0bopC1o+m3PDl8cm7q6jjp/zkKH41wO5H7UQNzTbfZ0SjoabElkg30Vb91IzQJzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqGbBVSnLWOsb0GjduMe0FCldOVEFSwhe97AEWkvM2KwIgXuK30Nnzhh7U/I9QiM2/Q+hphVIKqMVSbJE4A0FUzgk="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"kevinswiber","email":"kswiber@gmail.com"},"maintainers":[{"name":"kevinswiber","email":"kswiber@gmail.com"}],"directories":{}},"0.1.2":{"name":"titan","version":"0.1.2","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":">=0.1.0"},"homepage":"https://github.com/argo/titan","_id":"titan@0.1.2","dist":{"shasum":"853ab1b85f2ca1d15e96b98d669c28bfcf191d7e","tarball":"https://registry.npmjs.org/titan/-/titan-0.1.2.tgz","integrity":"sha512-yG/T2KsrzYCSSVyjM3IhNde1Rw1wQ95mVVeIthfO0lP7zEPp42qU2bP+gKd0f2vMsDbo7cev81d15TBiAQtzOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRdodQR79SkWQ5m/8V1iZV4LqFREf+YfRqWAF/Wb8ruQIgWONwo2kzxvrl5xXUmGpVi3jfI+6YRCQwxHRo6D8Sg4Q="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"kevinswiber","email":"kswiber@gmail.com"},"maintainers":[{"name":"kevinswiber","email":"kswiber@gmail.com"}],"directories":{}},"0.1.3":{"name":"titan","version":"0.1.3","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":">=0.2.0"},"homepage":"https://github.com/argo/titan","_id":"titan@0.1.3","dist":{"shasum":"ca63d1f4a3eb0590c9be50e77104b3ac30ca44bf","tarball":"https://registry.npmjs.org/titan/-/titan-0.1.3.tgz","integrity":"sha512-PRIjcsYIxiDlmwBY5ga5vk71JI1eEBjX9WK9LOdEMenDEic85ph6AZlDcZPiqRigYlfbGDM8apSXtkpvc+nweA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDATH/y9coHgEJbHl0m5sqWshnxTaleUW17NAG1xWToPAiAcDxLpvyrv1k570dmxO/bcz4gQiChN8kda1gzZfq9tFg=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"kevinswiber","email":"kswiber@gmail.com"},"maintainers":[{"name":"kevinswiber","email":"kswiber@gmail.com"}],"directories":{}},"1.0.0":{"name":"titan","version":"1.0.0","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":">=0.2.0"},"gitHead":"7bc10f91793ccc9dd2756a3f37a812819db01582","homepage":"https://github.com/argo/titan","_id":"titan@1.0.0","_shasum":"909d5193a544cc8b3846dae9cac75d953547153c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"mdobs","email":"mdobson4@gmail.com"},"maintainers":[{"name":"adammagaluk","email":"AdamMagaluk@gmail.com"},{"name":"kevinswiber","email":"kswiber@gmail.com"},{"name":"mdobs","email":"mdobson4@gmail.com"}],"dist":{"shasum":"909d5193a544cc8b3846dae9cac75d953547153c","tarball":"https://registry.npmjs.org/titan/-/titan-1.0.0.tgz","integrity":"sha512-yspd4iwuP8AiOaRlVO+hpB/aJTlDFnApZjimx2qpLD3sW6W9SB17DRLbQclvDHvTmgD4o66k3XY0IUsHD69Vrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMlCWXwg7u5LgQbfVgqDwxdBC4ktjIdgn1N7dplmE2pwIgMcaJWrXol9FREyofaE8Kz9eFlHLycU9sdZURZV2f2vA="}]},"directories":{}},"1.1.0":{"name":"titan","version":"1.1.0","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":">=0.4.0"},"gitHead":"e2f8f543812040f1021ef1bb7fcb732589360057","homepage":"https://github.com/argo/titan#readme","_id":"titan@1.1.0","_shasum":"a21df60ff6cffcc8b0353344df9f897c4370616d","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"mdobs","email":"mdobson4@gmail.com"},"dist":{"shasum":"a21df60ff6cffcc8b0353344df9f897c4370616d","tarball":"https://registry.npmjs.org/titan/-/titan-1.1.0.tgz","integrity":"sha512-cGqd0lNb8jBNXAestBV5K2SMa54ocZkQ32NCq9d1POM/ti7ZiV1Cca+8N36Nr2mm4DFo1Oz4gr5jUbFKm6W4uw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHKr36RzpxSwgNQ6vLuHxohYseONAQ/5YwGN+KyV4H/QAiEA7FRPJZU/cjEqVxK/BqceTBTPh54kq95NBVzkTMxY5F0="}]},"maintainers":[{"name":"adammagaluk","email":"AdamMagaluk@gmail.com"},{"name":"kevinswiber","email":"kswiber@gmail.com"},{"name":"mdobs","email":"mdobson4@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/titan-1.1.0.tgz_1461782504793_0.14978922298178077"},"directories":{}},"1.2.0":{"name":"titan","version":"1.2.0","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":">=0.4.1","argo-url-router":">=0.0.4","argo-resource":">=0.0.7","argo-clf":">=0.0.3","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-url-helper":">=0.5.0"},"gitHead":"fe4f95cf73356b2c30dc6531a7aa5821b8211670","homepage":"https://github.com/argo/titan#readme","_id":"titan@1.2.0","_shasum":"e171663774347bef602042779cbc9f64f2663343","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"adammagaluk","email":"AdamMagaluk@gmail.com"},"dist":{"shasum":"e171663774347bef602042779cbc9f64f2663343","tarball":"https://registry.npmjs.org/titan/-/titan-1.2.0.tgz","integrity":"sha512-geZy3ce925q5nI+N98ss7N7T/b1+gI9C4d+9yI+2p4k/ns4bvnU+kULlPkbzQ+Y0NrweB9jdy9UMydYE6PEiEg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHlUtyS3GeerF17JAKnjCeDagadj1Y2hr4d2lcvecGnxAiAJz0LQMmHOKp/T4IbJKllt1jGrnSWm5LVE1DWIzPR8ZQ=="}]},"maintainers":[{"name":"adammagaluk","email":"AdamMagaluk@gmail.com"},{"name":"kevinswiber","email":"kswiber@gmail.com"},{"name":"mdobs","email":"mdobson4@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/titan-1.2.0.tgz_1472673411871_0.26261208369396627"},"directories":{}},"1.3.0":{"name":"titan","version":"1.3.0","description":"A stellar API framework built on top of Argo.","main":"titan.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"keywords":["api","framework","argo","resource"],"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/argo/titan/issues"},"dependencies":{"argo":"^1.0.0","argo-clf":"^1.0.0","argo-formatter":">=0.0.0","argo-gzip":">=0.2.0","argo-resource":"^1.0.0","argo-url-helper":">=0.5.0","argo-url-router":">=0.0.4"},"homepage":"https://github.com/argo/titan#readme","directories":{"example":"example"},"devDependencies":{},"gitHead":"ac9bc29e8de71df2a616e3b1eb63a5d1e0b78a3a","_id":"titan@1.3.0","_nodeVersion":"10.21.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-fe1ASe7K1kQhCaUgs7SEOMkc0cQLhptPkzgd9HWJGUKi8ogTFN4wywCsK62H5thodi8R1g3Z86WxjMHZ3kaucQ==","shasum":"1509cfdacbcaadda858e9821474cedb991e096f4","tarball":"https://registry.npmjs.org/titan/-/titan-1.3.0.tgz","fileCount":7,"unpackedSize":15772,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfEd6kCRA9TVsSAnZWagAA51oP/2N0tQYzQL1RK9oBC3sh\n+2JbJQWOwsGY2t2LNrZxe2vieA0YnodB5ZEMBLhBmNdxT6KEe/UpuazZU1ih\ndzGDD8AZJAp5bqiQESiaroazZZS7BhVtr4UKtqXNE5jfU0bl6HSmMVD2ffya\n5YkJhsKvGUA7703cQz6aw2UCno33lJh8ckiX67WLxis0k98N4ZvL7IFYMDzW\n1AqXR2K0iSghRZRsOLzBfdpAdsm/YQyXQ42h7gYqFR1WbUz7arjTQNR6vp9s\nMg1wR66Ed8flixI9nLOcscgqgOYN7ME1xCMsALetM0RnbWQ24xCN3aXZRIfb\nE/NaZaMj9LhxpbmfmBcbz1zvI5JJWab+2SnzOEXlqtdvcIL+uJBCEmSCBRXB\nJgfrgv+8A7vo9dAjrhkWk0bgyXwxm9eF8YcWn7Ip/dg6Fb4St3+g2z5HGnLn\nks/zF4vn2YCTWk5z8oKl+FVD7rQxiNRJfzkU93ydQOyLXHbaokpYTkT/G9KJ\n04bKuYDdsm2ct6fMFe9SSNQsg5bDzaefHJOCJURzfs8tF0fwhIdAZFlZ/nHD\n3wzGcR2l05oATDZWZvJmjJ/4GiIjT9LP8Z+hLbMYPGMhhTbJBvYEe2eAQbLC\nqlvElTZ72UVBMSnFkBIk3jsJvhy5ibC9+RnztnjA82W6nPijuEplWXBgespQ\nEC8f\r\n=gkkC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIFsT82k0W7SgoxSw7RQpO0nxnY0fNgsZs+OcziHNpyAIgb5AXnBX0+AJUX5abauTE/8MnhhTgkdV9lSp3rnvw4oI="}]},"maintainers":[{"email":"ADamMagaluk@gmail.com","name":"adammagaluk"},{"email":"kswiber@gmail.com","name":"kevinswiber"},{"email":"mdobson4@gmail.com","name":"mdobs"}],"_npmUser":{"name":"adammagaluk","email":"ADamMagaluk@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/titan_1.3.0_1595006628243_0.9628344945706231"},"_hasShrinkwrap":false}},"readme":"# Titan: Stellar APIs\n<!-- Titan is:\n\n* An API-focused HTTP server and framework.\n* A reverse proxy to manage and modify HTTP requests and responses.\n* Modular using handlers for request and response pipelines.\n* Extensible using a package system.\n\nAs an API server:\n\n* Route requests to handlers.\n* Separate resources into modules.\n\nAs a reverse proxy:\n\n* Route requests to backend servers.\n* Transform HTTP messages on the fly.\n* Add OAuth 2.0 support to an existing API.\n* Create a RESTful API façade over legacy systems.\n\n-->\n\nA stellar API framework built on top of Argo. Titan will provide any API management functionality needed by modern API developers.\n\n1. CORS Management\n2. Compression\n3. Logging\n4. API Resource Definition\n5. Interoperable with Argo Packages\n\nGrab this package off npm using the command.\n\n```bash\n$ npm install titan\n```\n## Hello World!\n\nThe basic Titan server looks like this.\n\n```javascript\nvar titan = require('titan');\n\ntitan()\n  .use(function(handle) {\n    handle('response', function(env, next) {\n      env.response.body = {'text': 'Hello World'};\n      env.response.statusCode = 200;\n      env.response.setHeader('Content-Type', 'application/json');\n      next(env);  \n    });  \n  })\n  .listen(3000);\n```\n\n## Documentation \n\n* [handleFunction](#handleFunction)\n* [use(handleFunction)](#usehandle)\n* [use(package)](#usepackage)\n* [route](#route)\n* Method filters\n  * [get](#get)\n  * [post](#post)\n  * [put](#put)\n  * [patch](#patch)\n  * [del](#del)\n  * [options](#options)\n  * [trace](#trace)\n* [map](#map)\n* [allow](#allow)\n* [compress](#compress)\n* [logger](#logger)\n* [add](#add)\n\n \n<a name=\"handleFunction\"/>\n### handleFunction(type, [options], callback)\n\n* `type`: `'request'` or `'response'`\n\n* `options`: Mostly used for internal purposes.  Optional.\n\n* `callback(env, next)`: A request or response callback. `env` is an environment context that is passed to every handler, and `next` is a reference to the next function in the pipeline.\n\nWhen the handler is complete and wishes to pass to the next function in the pipeline, it must call `next(env)`.\n\n<a name=\"usehandle\"/>\n### use(handleFunction)\n\n`handleFunction` is used to set up request and response handlers.  \n\n```javascript\ntitan()\n  //For every request add 'X-Custom-Header' with value 'Yippee!'\n  .use(function(handle) {\n    handle('request', function(env, next) {\n      env.request.headers['X-Custom-Header'] = 'Yippee!';\n      next(env);\n    });\n  })\n```\n<a name=\"usepackage\"/>\n### use(package)\n\nAlias for `include(package)`.\n\n<a name=\"route\"/>\n### route(path, [options], handleFunction)\n\n* `path`: a regular expression used to match HTTP Request URI path.\n\n* `options`: an object with a `methods` property to filter HTTP methods (e.g., `{ methods: ['GET','POST'] }`).  Optional.\n\n* `handleFunction`: Same as in `use`.\n\nExample:\n\n```javascript\ntitan()\n  .route('^/greeting$', function(handle) {\n    handle('request', function(env, next) {\n      env.response.statusCode = 200;\n      env.response.headers = { 'Content-Type': 'text/plain' };\n      env.response.body = 'Hello World!';\n \n      next(env);\n    });\n  })\n```\n\n\n### Method filters\n<a name=\"get\"/>\n<a name=\"post\"/>\n<a name=\"put\"/>\n<a name=\"patch\"/>\n<a name=\"del\"/>\n<a name=\"options\"/>\n<a name=\"trace\"/>\n\nMethod filter built on top of `route`. `del` corresponds to\nthe DELETE method.\n\nExample:\n\n```javascript\ntitan()\n  .get('^/puppies$', function(handle) {\n    handle('request', function(env, next) {\n      env.response.body = JSON.stringify([{name: 'Sparky', breed: 'Fox Terrier' }]);\n      next(env);\n    });\n  })\n```\n<a name=\"map\"/>\n### map(path, [options], titanSegmentFunction)\n\n`map` is used to delegate control to sub-Argo instances based on a request URI path.\n\n* `path`: a regular expression used to match the HTTP Request URI path.\n\n* `options`: an object with a `methods` property to filter HTTP methods (e.g., `{ methods: ['GET','POST'] }`).  Optional.\n\n* `titanSegmentFunction`: a function that is passed an instance of `argo` for additional setup.\n\nExample:\n\n```javascript\ntitan()\n  .map('^/payments', function(server) {\n    server\n      .use(oauth)\n      .target('http://backend_payment_server');\n  })\n```\n\n<a name=\"allow\"/>\n### allow([options])\n\n`allow` enables CORS support for your titan server.\n\nNOTE: To enable CORS for any domain provide an asterisk (*) as the argument to this function.\n\n* `options`: an object with:\n  * a `methods` property to filter HTTP methods (e.g., `{ methods: ['GET','POST'] }`).\n  * a `headers` property to filter when HTTP Headers are allowed to be included in the request.(e.g. `{headers: ['x-tenant-id']}`).\n  * a `maxAge` property to indicate how long a preflight request can be cached. (e.g. `{maxAge: '43200'}`).\n  * an `origins` property to filter which domains can access the resource (e.g. `{ origins: ['http://foo.example'] }`).  \n\nExample:\n\n```javascript\ntitan()\n  .allow('*')\n```\n\n```javascript\ntitan()\n  .allow({\n    methods: ['DELETE', 'PUT', 'PATCH'],\n    origins: ['http://foo.example'],\n    maxAge: '432000',\n    headers: ['x-tenant-id']  \n  })\n```\n\n<a name=\"compress\"/>\n### compress()\n\n`compress` enables gzip compression for your titan server.\n\nExample:\n\n```javascript\ntitan()\n  .compress()\n```\n\n<a name=\"logger\"/>\n### logger()\n\n`logger` turns on a Common Log Format logger for your titan server.\n\nExample:\n\n```javascript\ntitan()\n  .logger()\n```\n\n<a name=\"add\"/>\n### add(resource, args)\n\n`add` adds an additional argo-resource package to your titan server. See the [argo-resource](http://github.com/argo/argo-resource) repo for details on creating resources.\n\n```javascript\nvar HelloResource = require('./hello_resource');\n\ntitan()\n  .add(HelloResource);\n```\n\n<a name=\"load\"/>\n### load(pathToResources)\n\n* `pathToResource`: String path to directory containing argo resource files. \n\n`load` loads a directory of argo-resource files without having to specifiy each one individually.  \n\n```javascript\nvar HelloResource = require('./hello_resource');\n\ntitan()\n  .load(path.join(__dirname, 'resources'));\n```\n\n## Issues and Contributing\n\nHave and issue? Simply file it with github issues. This project has been stable for about a year, but issues do arise from time to time.\n\nWant to contribute? Simply fork the project, make your changes, and file a pull request. We'll review within two to three days of receiving and provide feedback accordingly. \n\n## License\n```\nCopyright (c) 2014-2015 Apigee and Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","maintainers":[{"email":"ADamMagaluk@gmail.com","name":"adammagaluk"},{"email":"kswiber@gmail.com","name":"kevinswiber"},{"email":"mdobson4@gmail.com","name":"mdobs"}],"time":{"modified":"2022-06-27T07:08:59.387Z","created":"2013-10-22T21:24:19.511Z","0.0.6":"2013-10-22T21:24:21.695Z","0.0.0":"2013-10-31T14:39:33.680Z","0.1.0":"2014-01-02T19:49:53.544Z","0.1.1":"2014-01-03T19:02:16.787Z","0.1.2":"2014-09-18T14:53:17.150Z","0.1.3":"2014-10-21T01:15:26.291Z","1.0.0":"2015-09-09T18:23:33.884Z","1.1.0":"2016-04-27T18:41:45.901Z","1.2.0":"2016-08-31T19:56:53.846Z","1.3.0":"2020-07-17T17:23:48.349Z"},"author":{"name":"Kevin Swiber","email":"kswiber@gmail.com"},"repository":{"type":"git","url":"git://github.com/argo/titan.git"},"homepage":"https://github.com/argo/titan#readme","keywords":["api","framework","argo","resource"],"bugs":{"url":"https://github.com/argo/titan/issues"},"license":"MIT","readmeFilename":"README.md","users":{"scotty":true}}