{"_id":"@aaronburt/bunhost","_rev":"1-42bfa91312cc14c82d8f304191bd363d","name":"@aaronburt/bunhost","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@aaronburt/bunhost","module":"index.ts","type":"module","devDependencies":{"@types/mime":"^3.0.1","bun-types":"^0.4.0"},"dependencies":{"mime":"^3.0.0"},"description":"This is a simple router for creating dynamic and static routes in a TypeScript Node.js application using NodeNext","version":"1.0.0","main":"index.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["bun"],"author":{"name":"aaronburt"},"license":"MIT","_id":"@aaronburt/bunhost@1.0.0","_nodeVersion":"18.12.1","_npmVersion":"9.1.2","dist":{"integrity":"sha512-3MYeqBV9x0BHljHL/UiUUSEM6qV5dyxaLh46cLyw9MBNqU7E6IhEHuyes3GYmMf2qKLTVzF4cTW/sccbJgdlQw==","shasum":"1e0c16d086725cf00b97b0309a36864ed325c07b","tarball":"https://registry.npmjs.org/@aaronburt/bunhost/-/bunhost-1.0.0.tgz","fileCount":5,"unpackedSize":6192,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa+niotAM4/dnBl8AwQAh3Idmylp8rftjoEb+D1yTxUAiEAnHbtOinRFbIdlgeuKdjvuiyMnx9292AKj2lLiIPbuts="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuWSjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq41Q/+KdERA0kn2DNUSABAnEVrxYkghrSxXkteD/BBOx3gmympaAUH\r\nbWl3jOU1qiVb4hegVcJogHFeEAcLbZy2qppcvd7P94615wZVkpPB7SPJwicc\r\nc6jVHzTvrxDsErVW4/wj/W75qPjmAWLphM3spXE7hJTIWI6TlihBGVzmNtpM\r\nI2yBasTyMQeYOP7gmBGpt/3UKJU5t6v5/ngKz2RHFbbQDW8isDtVGNK7ZnvR\r\nYQG5RjrzmuABM5gUgvkUgzdmPNhxszosJdzR3+fxB0PJjIuQCOtadnMkW2BH\r\n3YDK3JqM9ybofwapAdFnMHShtWN0bJm6S6VgN3r/a70MVgksuV3sQqt5wqCc\r\n6eBhiwHe79R/9AU8B6FxYCIfNaHP78dWxqlHnAh66EHZ3NMD4ov5dgi3ow6L\r\nm18f4xoDBV2H8TdPsNb4U/jSfx34pZIFGhXxGIe7Cwm2eaqsgLiAjyblobW7\r\n/ED6RJ+HpCyzyC63FHFjfILItLOqEHEsdEHvEAaTcSSMcI9jMIoN7XGccd3i\r\n2r8NiZdlvDh30eHPO4gNfVbHgw9Kog7Ld/cuOQmgajLKXnfWjtrFAdJqfj7J\r\nFTyeU8CAzsSDWJQo6UXAvS9cR4TnZovDGyqfL59FNw+pxLRZjWYATQCe++JF\r\nj7kdsqaWqEVQ9OtIhAVPlpbtAW/RMOFdKIU=\r\n=cGNT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aaronburt","email":"npm@aaronburt.co.uk"},"directories":{},"maintainers":[{"name":"aaronburt","email":"npm@aaronburt.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bunhost_1.0.0_1673094307700_0.3644357321313987"},"_hasShrinkwrap":false},"2.0.0":{"name":"@aaronburt/bunhost","module":"index.ts","type":"module","devDependencies":{"@types/mime":"^3.0.1","bun-types":"^0.4.0"},"dependencies":{"mime":"^3.0.0"},"description":"This is a simple router for creating dynamic and static routes in a TypeScript Node.js application using NodeNext","version":"2.0.0","main":"index.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["bun"],"author":{"name":"aaronburt"},"license":"MIT","_id":"@aaronburt/bunhost@2.0.0","_nodeVersion":"18.12.1","_npmVersion":"9.1.2","dist":{"integrity":"sha512-G6+or1GBHwC+b3f8RVI+gNQFhEWla6s6hi4moXsZcNTgbTBoXGZHQnf00hPtNDJMmbM9S+e7Koh9sJ0GgYVfcA==","shasum":"aab442203c586041aa8570a773c234fc459040d9","tarball":"https://registry.npmjs.org/@aaronburt/bunhost/-/bunhost-2.0.0.tgz","fileCount":6,"unpackedSize":6087,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5uJHk90145O1Be41kbWok5RO4MBZDdlJ+79sdoj21JAIgbkjN4EU2qhveUIFeayFvimNSkZ+SOq/g9QDaFAaEQTM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuWW9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpsRA//UcNgQYJ7T+Gz4D4xDc5SB+dAuh18Re2GA3J+1yb9jSkAFo2z\r\nJPS3fD3POLuSgFdSCoFbMp+MfiiFS2q80/nGt0fqPK1a45eNK10tm+jOyB9Y\r\nh/SJ0v2+Sd+4QqzjRCz0lyesGoeMs5d7pyYemYLzuVh7L3Pl3xyy9Mi9616O\r\n4eqbqezTiF4s8+gxAQSyFm6xq+uFZMhLBxl6cT08c8p++tGoccxNVPARPwag\r\n1UVV1E0Zfm61AhDNOB0bAm5PnHGxMiHL0s34nrSUcmjQPU//Y9C02N2BWGzW\r\nG7BauAXT/3hmlxdT8KeZS1pJDuQZ5bbr2pVAtu0osTH2fnQx1C6Z6+IBzw+S\r\nbb9tu2bmVR3S8CAUgxbGCIlM47QGOFkU3LSoTzLokl6nKVcDMXjf7pgCN7N9\r\n2F5PFPaCp8DaurV8bpnz4YVcExTqGgylFgxYMJw/9u4QhzIT17Ctr2o5xJ5h\r\nCW83+N4px8or+DbDLpOGWYtsmTXTo6CKErpclwqya2liuj+QO+Y2WQ124PPM\r\ntPAc93QFiynTh0A0NlKh9Rp+sLSPVhLPWki8Eazt+UEC0VZNk8RYX8xVy6Kl\r\nZpkZPA2vxdjSwdBf+klu1Q1EQaI3WkBgRNoRCZUAFViGN+vUeTz6/CYrN1cU\r\n66REfT+vjeae+niCDw+YFXnPX4E8gos7gzA=\r\n=VLGA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aaronburt","email":"npm@aaronburt.co.uk"},"directories":{},"maintainers":[{"name":"aaronburt","email":"npm@aaronburt.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bunhost_2.0.0_1673094589573_0.7043842118659212"},"_hasShrinkwrap":false}},"time":{"created":"2023-01-07T12:25:07.652Z","1.0.0":"2023-01-07T12:25:07.867Z","modified":"2023-01-07T12:29:49.817Z","2.0.0":"2023-01-07T12:29:49.742Z"},"maintainers":[{"name":"aaronburt","email":"npm@aaronburt.co.uk"}],"description":"This is a simple router for creating dynamic and static routes in a TypeScript Node.js application using NodeNext","keywords":["bun"],"author":{"name":"aaronburt"},"license":"MIT","readme":"# Router\nThis is a simple router for creating dynamic and static routes in a TypeScript Node.js application using NodeNext\n\nFeatures\nCreate dynamic routes for HTTP methods: GET, POST, PUT, DELETE\nCreate static routes for serving files\nUses mime library to set the correct Content-Type header for static files\nUsage\nSetting up the router\nCreate an instance of the Router class:\n\n```\nimport Router from './router';\nconst router = new Router();\n```\n\n## Creating dynamic routes\nUse the get, post, put, and delete methods to create dynamic routes:\n\n```\nrouter.get('/users', (request: Request) => {\n  // handle GET request to '/users' route\n  return new Response('Success');\n});\n\nrouter.post('/users', (request: Request) => {\n  // handle POST request to '/users' route\n  return new Response('Success');\n});\n\n```\n## Creating static routes\nUse the addStatic method to create a static route for serving a file:\n\n```\nrouter.addStatic('/images/fileName', './images/fileName');\n```\nThis will create a route that serves the file located at ./images/fileName when a request is made to /images/:fileName. \n\nUse the listen method to start the server:\n\n```\nrouter.listen(3000);\n```\nThis will start the server on port 3000.\n\n","readmeFilename":"README.md"}