title: How to make a web server using Erlang
body: <p>I'm new with Erlang </p>
  
  <p>I try to make a web server with Erlang. How to do it with Erlang?
  I was using this code to make a local:</p>
  
  <pre><code>-module(test). 
  -export([start/0,service/3]). 
  
  start() -&gt;
     inets:start(httpd, [ 
        {modules, [ 
           mod_auth, 
           mod_esi, 
           mod_actions, 
           mod_cgi, 
           mod_dir,
           mod_get, 
           mod_head, 
           mod_log, 
           mod_disk_log 
        ]}, 
  
        {port,8082}, 
        {server_name,"helloworld"}, 
        {server_root,"C://xampp//tmp"}, 
        {document_root,"C://xampp//htdocs"}, 
        {erl_script_alias, {"/erl", [test]}}, 
        {error_log, "error.log"}, 
        {security_log, "security.log"}, 
        {transfer_log, "transfer.log"}, 
  
        {mime_types,[ 
           {"html","text/html"}, {"css","text/css"}, {"js","application/x-javascript"} ]} 
     ]). 
  
  service(SessionID, _Env, _Input) -&gt; mod_esi:deliver(SessionID, [ 
     "Content-Type: text/html\r\n\r\n", 
     "&lt;DOCTYPE html&gt;
     &lt;head&gt;
     &lt;meta charset='utf-8'&gt;
     &lt;meta http-equiv='X-UA-Compatible' content='IE=edge'&gt;
     &lt;meta name='viewport' content='width=device-width, initial-scale=1'&gt;
     &lt;title&gt;HTML1&lt;/title&gt;
     &lt;script
       src='https://code.jquery.com/jquery-3.2.1.js'
       integrity='sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE='
       crossorigin='anonymous'&gt;&lt;/script&gt;
     &lt;link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet'/&gt;
     &lt;link href='css/test1.css' rel='stylesheet'/&gt;
     &lt;script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'&gt;&lt;/script&gt;
     &lt;/head&gt;
        &lt;html&gt;
        &lt;body&gt;Ham oc cho!
           &lt;div class='header'&gt;
              &lt;ul class='first'&gt;
                 &lt;li class='col-md-4'&gt;&lt;a href='#' &gt;Tai khoan cua toi&lt;/a&gt;&lt;/li&gt;
                 &lt;li class='col-md-4'&gt;&lt;a href='#' &gt;Trang thai don hang&lt;/a&gt;&lt;/li&gt;
                 &lt;li class='col-md-4'&gt;&lt;a href='#' &gt;Danh sach ua thich&lt;/a&gt;&lt;/li&gt;
                 &lt;li class='col-md-4'&gt;&lt;a href='#' &gt;Gio hang&lt;/a&gt;&lt;/li&gt;
                 &lt;li class='col-md-4'&gt;&lt;a href='#' &gt;Dang nhap&lt;/a&gt;&lt;/li&gt;
                 &lt;li class='col-md-4'&gt;&lt;a href='#' &gt;Dang ky&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
           &lt;/div&gt;
        &lt;/body&gt;
        &lt;/html&gt;" ]).
  </code></pre>
  
  <p>But I don't see any way to add a css-js file and don't know how to write a backend to this.</p>
  
  <p>If you guy have some example or document pls share me </p>