<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Leo Khramtsov</title>
    <description>The latest articles on DEV Community by Leo Khramtsov (@nvrenuff).</description>
    <link>https://dev.to/nvrenuff</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378191%2F2d798736-82e0-4b74-a90a-0e93f378592d.jpeg</url>
      <title>DEV Community: Leo Khramtsov</title>
      <link>https://dev.to/nvrenuff</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nvrenuff"/>
    <language>en</language>
    <item>
      <title>Simplex node.js http server</title>
      <dc:creator>Leo Khramtsov</dc:creator>
      <pubDate>Sat, 02 May 2020 16:58:41 +0000</pubDate>
      <link>https://dev.to/nvrenuff/simplex-node-js-http-server-5cfi</link>
      <guid>https://dev.to/nvrenuff/simplex-node-js-http-server-5cfi</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hello everyone, I've built a simple Node.js Http-Server with router. I wanted to build a server with routing support without using any third party libraries.&lt;/p&gt;

&lt;p&gt;Right now it does not support any middleware or request body parsing, it is something i want to explore adding in the future.&lt;/p&gt;

&lt;h5&gt;
  
  
  Key supported features:
&lt;/h5&gt;

&lt;p&gt;MIME types for most common files&lt;br&gt;
Serves HTML, JS, CSS, plain text and images&lt;br&gt;
Serves index.html as a default directory index&lt;br&gt;
Responds with error codes for missing files&lt;br&gt;
Ability to set route aliases&lt;br&gt;
Ability to set custom routes&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4TzVN7IN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/14v8n4zca4hrxlklogin.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4TzVN7IN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/14v8n4zca4hrxlklogin.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Static assets
&lt;/h5&gt;

&lt;p&gt;Static assets are served from /public directory&lt;/p&gt;

&lt;p&gt;/public - HTML files&lt;br&gt;
/public/static&lt;br&gt;
/public/static/css - CSS files&lt;br&gt;
/public/static/images - Images&lt;br&gt;
/public/static/js - Javascript files&lt;/p&gt;

&lt;h5&gt;
  
  
  Route Aliases
&lt;/h5&gt;

&lt;p&gt;Route aliases can be set in /routes/aliases.js&lt;/p&gt;

&lt;p&gt;"/": "/index.html",&lt;br&gt;
  "/about": "/about.html",&lt;br&gt;
  "/contact": "/contact.html",&lt;br&gt;
  "404": "/404.html",&lt;/p&gt;

&lt;h3&gt;
  
  
  Source Code
&lt;/h3&gt;

&lt;p&gt;You can view source code on GitHub &lt;a href="https://github.com/nvrenuff/simplex-http-server"&gt;https://github.com/nvrenuff/simplex-http-server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Feel free to use this for leaning purposes or simple non production projects.&lt;/p&gt;

&lt;p&gt;Any feedback, recommendations are welcome :)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
    </item>
  </channel>
</rss>
