Posts

Showing posts from November 28, 2018

'selectedHandler' is not a function, Node JS

Image
up vote 1 down vote favorite I am a newbie with Node JS and i recently made all the APIs which are working exactly as i want. However, now i want some of them (example handler.home) to return a static html template also. But, now i am getting an error as below.... Server.js const config = require('../config'); //Dependencies const http = require('http'); const https = require('https'); //file system support to read files var fs = require('fs'); //path module to access directories var path = require('path'); var url = require('url'); //importing the handlers var handlers = require('./handlers'); //importing helpers var helpers = require('./helpers'); var stringDecoder = require('string_decoder').StringDecoder; //server object to handle al