<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1"><title>Category: Web Dev | TheBestJohn</title><linkrel="stylesheet"href="/libs/font-awesome/css/font-awesome.min.css"><linkrel="stylesheet"href="/css/index.css"><linkrel="stylesheet"href="/css/highlights/dracula.css"><linkrel="canonical"href="http://blog.thebestjohn.com/categories/Web-Dev/"/>
<metaname="description"content="Just a place to make stuff">
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1"><title>taking a look at things | TheBestJohn</title><linkrel="stylesheet"href="/libs/font-awesome/css/font-awesome.min.css"><linkrel="stylesheet"href="/css/index.css"><linkrel="stylesheet"href="/css/highlights/dracula.css"><linkrel="canonical"href="http://blog.thebestjohn.com/"/>
<metaname="description"content="Just a place to make stuff">
<p>Originally I thought I would install it, set up an apache virtual reverse proxy via an <code>.htaccess</code> file and let node serve static files. Some people do this. It’s a valid way to serve a site. The problem that I have with this, is that it’s just another vulnerable layer of code that I don’t have the inclination to audit. It could potentially have glaring security holes and I wouldn’t know. Again, I want to clarify that I don’t know much of anything about security. I’m not a cryptographer, nor an expert on cyber security. However, I can easily read the html that comes out the other end of the site generator and verify that there are no well-known issues with the javascript or html.</p>
<p>If this is the way you wanted to do it, you would need, at the very least, this sort of <code>.htaccess</code> configuration in your root<br><figureclass="highlight plain"><table><tr><tdclass="gutter"><pre><spanclass="line">1</span><br><spanclass="line">2</span><br><spanclass="line">3</span><br><spanclass="line">4</span><br><spanclass="line">5</span><br><spanclass="line">6</span><br></pre></td><tdclass="code"><pre><spanclass="line">RewriteEngine On</span><br><spanclass="line">DirectoryIndex index.html </span><br><spanclass="line">RewriteRule ^$ http://127.0.0.1:4000 [P,L]</span><br><spanclass="line">RewriteCond %{REQUEST_FILENAME} !-f</span><br><spanclass="line">RewriteCond %{REQUEST_FILENAME} !-d</span><br><spanclass="line">RewriteRule ^(.*)$ http://127.0.0.1:4000/$1 [P,L]</span><br></pre></td></tr></table></figure></p>
<p>So what to do? Well, the output is a fully static html/css/js site. No need for node, no need for a reverse proxy. This will just work when popped into a public directory of a webserver.</p>