1.0.0 • Published 8 years ago

framework-building v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

framework-building

Routing using RESTful Api, GET, POST DELETE method. Basic http code provided by Charlie Crawford III.

Basic Usage

const http = require('http');
const Router = require('./router.js');
//Your routing constructor object name
const YourRouterName = new Router();

YourRouterName.get('/example/:id', (req, res) => {
  //writing a header {'content-type': 'text/html'}.
  res.lazyHeader('text');
  
  // writing a header {'content-type': 'application/json'}
  // Make sure what you write is json, otherwise errors.
  res.lazyHeader('json');

})

//creating http server calls
http.createServer(YourRouterName.route()).listen(3000, function(){
  debug('listening to port 3000...');
});