doug65536 / hellonode

Simplest possible node server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hellonode

Simple node server.

  • Serves the content of the public directory.
  • html files are preprocessed for directives
  • Paths are relative to the root of the public directory if they begin with /, otherwise they are relative to the file containing the file

Include syntax

<?include 'filename.html'?>
<?include "filename.html"?>
  • The closing quote must be the same kind as the opening quote.
  • Neither quote is allowed in the filename, regardless of which quote is wrapped around the value.
  • There is no escaping.
  • Relative paths are relative to the directory that contains the file doing the include.
  • Absolute paths are relative to the root of the public directory tree.
  • Any amount of space is permitted before and after the quotes around the filename. There must be at least one space after include, but there is no requirement for spaces after the closing quote.

Installation

cd somewhere-good
git clone https://github.com/doug65536/hellonode
cd hellonode
npm i

Run for debugging (auto-rerun on code changes)

npm run-script rerun

Run normally

npm run-script run

About

Simplest possible node server


Languages

Language:JavaScript 92.0%Language:HTML 8.0%