title: Node.js web app uploaded through A2 Hosting - pathing issue with CSS
body: <p>I am currently studying node.js and pretty new still so I apologize in advance for probably having an inefficient or terribly formatted first question. I am uploading a one-page test to figure out how to use A2's node.js service.</p>
  <p>So far I have followed the A2 tutorial &quot;How to create a Node.js application with cPanel using Node.js Selector&quot; (<a href="https://www.a2hosting.com/kb/cpanel/cpanel-software/create-application-with-nodejs-selector" rel="nofollow noreferrer">https://www.a2hosting.com/kb/cpanel/cpanel-software/create-application-with-nodejs-selector</a>) and this tutorial on syncing git repositories (<a href="https://medium.com/@pampas93/host-your-node-js-app-on-shared-hosting-go-beyond-localhost-73ab923e6691" rel="nofollow noreferrer">https://medium.com/@pampas93/host-your-node-js-app-on-shared-hosting-go-beyond-localhost-73ab923e6691</a>) and I have been able to get everything working except the main page</p>
  <p>(Located in dirname/repositories/test/views/home-visitor.ejs)</p>
  <p>will not read the CSS file I have uploaded</p>
  <p>(Located in: dirname/repositories/test/public/main.css)</p>
  <p>and some of the images do not load. No file name typos or forward slash &quot;/&quot; syntax inconsistencies, all images share the same folder path.</p>
  <p>(Located in: dirname/repositories/test/public/images)</p>
  <p>So the node.js app shows up as plain HTML only. I have uploaded the exact same app/git repository to Heroku and the CSS is read and all images show up, so I am trying to figure out what pathing issues I am having when uploading specifically to A2's hosting service.</p>
  <p>When I check 'inspect' on the browser for the non-working app page, I get these console messages:</p>
  <blockquote>
  <p>&quot;Refused to apply style from 'http://domainname.com/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.&quot;</p>
  </blockquote>
  <blockquote>
  <p>Failed to load resource: the server responded with a staus of 404 () nonWorkingImageExample.png:1</p>
  </blockquote>
  <blockquote>
  <p>Failed to load resource: the server responded with a staus of 404 () anotherNonWorkingImageExample.png:1</p>
  </blockquote>
  <p><a href="http://domainname.com/test/main.css" rel="nofollow noreferrer">http://domainname.com/test/main.css</a> sends to a 404 page</p>
  <p>app.js:</p>
  <hr />
  <pre><code>const express = require(&quot;express&quot;)
  const app = express()
  
  let port = process.env.PORT
  if (port == null || port == &quot;&quot;) {
    port = 3000
  }
  
  app.use(express.static(&quot;/public/&quot;))
  app.set(&quot;views&quot;, &quot;views&quot;)
  app.set(&quot;view engine&quot;, &quot;ejs&quot;)
  
  app.get(&quot;/test&quot;, function (req, res) {
    res.render(&quot;home-visitor&quot;)
  })
  
  app.listen(3000)
  </code></pre>
  <hr />
  <p>The page I am testing: home-visitor.ejs:</p>
  <pre><code>&lt;!DOCTYPE html&gt;
      &lt;html&gt;&lt;head&gt;
          &lt;meta charset=&quot;UTF-8&quot;&gt;
          &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge,chrome=1&quot;&gt;
          &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1&quot;&gt;
              
          &lt;link rel=&quot;stylesheet&quot; href=&quot;main.css&quot; type=&quot;text/css&quot;&gt;
      &lt;/head&gt;
      &lt;header&gt;          
          &lt;div class=&quot;forMobile mobileHeader&quot;&gt;
              &lt;div class=&quot;mobileLogo&quot;&gt;
                  &lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;images/workingImageExample.png&quot; alt=&quot;Image Description&quot;&gt; 
                  &lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;  
      &lt;/header&gt;
              
     &lt;div class=&quot;forDesktop centerContent tempMssg&quot;&gt;&quot;Lorem flexitarian salvia offal umami. Sartorial swag drinking portland cray. Godard jianbing retro thundercats hella tilde. &quot;
              
          &lt;br&gt;&lt;br&gt; 
          &lt;a href=&quot;#&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;
              &lt;img src=&quot;images/nonWorkingImageExample.png&quot; alt=&quot;Twitter Logo Link&quot; width=&quot;35px&quot; height=&quot;35&quot;&gt;
          &lt;/a&gt;
      &lt;/div&gt;                  
      &lt;div class=&quot;forMobile mobileUpperBG&quot;&gt;
          &lt;img src=&quot;images/anotherNonWorkingImageExample.png&quot; alt=&quot;upper left bg image&quot;&gt;
      &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I am hoping someone familiar with hosting node.js apps on A2 can help, and thank you for the time reading this question regardless.</p>