title: How to handle the static folder in deno
body: <p>I would like to know if it's possible to change the static resource file depending on the URL.
  For example, here is my folder pattern :</p>
  <pre><code>/root
  -&gt; server.ts
  -&gt; /project**s**
      -&gt; some libraries used in index.html files
      -&gt; /project1
         -&gt; index.html
         -&gt; some files used in the index.html
      -&gt; /project2
         -&gt; index.html
         -&gt; some files used in the index.html
  </code></pre>
  <p>and this is how to handle static files in deno using the oak library :</p>
  <pre><code>app.use(async (ctx, next) =&gt; {    
      await send(ctx, ctx.request.url.pathname, {
          root: `${Deno.cwd()}/static`,
      })
  
      next()
  });
  </code></pre>
  <p>My goal is when you type in the URL : <em>mydomain.com/project/project1</em>
  return you the <em>index.html</em> file corresponding to the project id.</p>
  <p>For now, I'm using oak router to redirect URLs like that:</p>
  <pre><code>const router = new Router();
  router.get('/project/:project_id', project)
  </code></pre>
  <pre><code>export const project = async (ctx: RouterContext) =&gt; {
      ctx.render(`${Deno.cwd()}/project**s**/` + ctx.params.projectid + '/index.html');
  }
  </code></pre>
  <p>Thanks for your help.</p>