Skip to content

ishidas/framework-building

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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...');
});

About

Creating a framework using REST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published