Skip to content

Instantly share code, notes, and snippets.

View codeofnode's full-sized avatar

Ramesh Kumar codeofnode

View GitHub Profile
@codeofnode
codeofnode / server.js
Last active July 30, 2018 09:01
Pure node js server where routes represents your directories
const { createServer } = require('http')
const { createReadStream } = require('fs')
const { parse } = require('url')
const { extname, resolve } = require('path')
const PORT = 9000
const HOST = '0.0.0.0'
const DOC_HANDLER = process.env.J2S_DOC_HANDLER || '_doc'
const DOC_CHECK = process.env.J2S_DOC_CHECK
const BASE_PATH = process.env.J2S_BASE_PATH || '/v0'