text: 'use strict'
  
  var express = require('express');
  var router = express.Router();
  var app = express();
  var bodyParser = require('body-parser');
  var cors = require('cors');
  var authorController  = require('../controllers/authorController');
  
  app.use(cors())
  router.use(cors())
  
  
  
  //support on x-www-form-urlencoded
  app.use(bodyParser.urlencoded({
    extended: true
  }));
  
  app.use(function (req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  });
  
  router.use(function (req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  });
  
  router.get('/getauthorlist',authorController.getAuthorList);
  router.post('/addauthor',authorController.addAuthor)
  
  module.exports = router;
  
  
  