{"id":15673438,"url":"https://github.com/jwebcoder/mith_static","last_synced_at":"2025-08-09T19:53:53.762Z","repository":{"id":72769516,"uuid":"271397224","full_name":"JWebCoder/mith_static","owner":"JWebCoder","description":"Serve static files under Mith framework","archived":false,"fork":false,"pushed_at":"2020-08-19T22:07:10.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T08:08:32.277Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://doc.deno.land/https/deno.land/x/mith_static/mod.ts","language":"TypeScript","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/JWebCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"JWebCoder","patreon":"jwebcoder","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-06-10T22:18:53.000Z","updated_at":"2020-08-19T22:06:47.000Z","dependencies_parsed_at":"2023-03-05T01:15:24.921Z","dependency_job_id":null,"html_url":"https://github.com/JWebCoder/mith_static","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JWebCoder","download_url":"https://codeload.github.com/JWebCoder/mith_static/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246281216,"owners_count":20752207,"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-10-03T15:40:35.456Z","updated_at":"2025-03-30T05:43:37.403Z","avatar_url":"https://github.com/JWebCoder.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JWebCoder","https://patreon.com/jwebcoder"],"categories":[],"sub_categories":[],"readme":"# Mith_static\n\n![mith ci](https://github.com/JWebCoder/mith_static/workflows/mith%20static%20ci/badge.svg)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/mith_static/mod.ts)\n\nServe static files under [Mith framework](https://github.com/JWebCoder/mith)\n\n## Usage\n\n**Basic integration**\n```typescript\nimport { Mith } from 'https://deno.land/x/mith@v0.7.0/mod.ts'\nimport { serverStatic } from 'https://deno.land/x/mith_static@v0.0.1/mod.ts'\n\nconst { env } = Deno\n\nconst app = new Mith()\napp.use(serveStatic(resolve(Deno.cwd(), 'static'), '/static', {\n  maxage: 120,\n}))\napp.use((req, res, next) =\u003e {\n  if (!req.requestHandled) {\n    return next({status: 404, message:'not found'})\n  }\n  next()\n})\napp.error(\n  (req: Request, res: Response, next: NextFunction) =\u003e {\n    if (res.error) {\n      res.status = res.error.status || 500\n      res.body = res.error.message\n    }\n    next()\n  }\n)\n\nconst PORT = Number(env.get('PORT')) || 8000\napp.listen({ port: PORT})\nconsole.log('listening on', PORT)\n```\n\nRight now I'm still working on the documentation, so you can check the **example** folder for full usage examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fmith_static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwebcoder%2Fmith_static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fmith_static/lists"}