title: The system cannot find the file specified. (os error 2) in Deno
body: <p><strong>Rendering HTML,CSS and Static Files inside Deno with View Engine Template <br></strong>
  MyCode:<br>
  <strong>Folder Structure</strong></p>
  
  <pre><code>-public
    -css
       -main.css
    -js
       -app.js
  -views
    -index.ejs
  -server.ts
  
  
  </code></pre>
  
  <p><strong>server.ts</strong></p>
  
  <pre><code>/*  Introduction To Rendering HTML,CSS and Static Files inside Deno with View Engine Template */
  
  // Importing Required Files And Packages Here.
  import { Application, Router, send } from "https://deno.land/x/oak/mod.ts";
  import {
    viewEngine,
    engineFactory,
    adapterFactory,
  } from "https://deno.land/x/view_engine/mod.ts";
  
  // Initializing App Here.
  const app = new Application();
  
  //  Setting Up Ejs Templating Engine Here.
  const ejsEngine = engineFactory.getEjsEngine();
  const oakAdapter = adapterFactory.getOakAdapter();
  
  // Serving A Static Folder Here.
  app.use(async (ctx,next)=&gt;{
      await send(ctx,ctx.request.url.pathname,{
          root :`${Deno.cwd()}/public`
      })
      next();
  })
  
  // Initializing Router Here.
  const router = new Router();
  
  // Defining Routes Here.
  router.get("/test", (ctx) =&gt; {
    ctx.render("views/index.ejs", {
      payload: {
        text: "test",
      },
    });
  }).get("/", (ctx) =&gt; {
      ctx.render("views/index.ejs", {
        payload: {
          text: "&lt;h1&gt;Introduction To Templating Engines In Deno. &lt;/h1&gt;",
        },
      });
    });
  
  
  
  // MiddleWares Here.
  app.use(viewEngine(oakAdapter, ejsEngine));
  app.use(router.routes());
  app.use(router.allowedMethods());
  
  console.log("Server Started On Port Number 8000.");
  await app.listen({ port: 8000 });
  
  // Run : deno run --allow-net --allow-read server.ts
  </code></pre>
  
  <p><strong>views/index.ejs :</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
      &lt;title&gt;Templating Engines&lt;/title&gt;
      &lt;link rel="stylesheet" href="/css/main.css" /&gt;
      &lt;script src="/js/app.js" defer&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Welcome To Deno World!&lt;/h1&gt;
      &lt;div&gt;&lt;%- payload.text %&gt;&lt;/div&gt;
      &lt;p id="content"&gt;&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  
  </code></pre>
  
  <p><strong>public/css/main.css</strong></p>
  
  <pre><code>p{
      color:red;
  }
  </code></pre>
  
  <p><strong>public/js/app.js</strong></p>
  
  <pre><code>const content = document.getElementById("content");
  
  const getDataJsFile = () =&gt; {
    content.innerHTML = `
      Java script Dummy Text  ::::::==&gt;
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Nesciunt quaerat
      perferendis consectetur doloribus repellendus ullam corrupti explicabo
      placeat reprehenderit ad.`;
  };
  
  getDataJsFile();
  </code></pre>
  
  <p>when i run this code <strong>deno run --allow-net --allow-read server.ts</strong> . <a href="http://localhost:8000/" rel="nofollow noreferrer">http://localhost:8000/</a> is working fine but in <a href="http://localhost:8000/test" rel="nofollow noreferrer">http://localhost:8000/test</a> , i am  getting this error : </p>
  
  <blockquote>
    <p>The system cannot find the file specified. (os error 2) in Deno</p>
  </blockquote>