express = require 'express'
router = express.Router()

# Search
router.get '/search', (req, res) ->
  res.render 'search/results', (
    title: req.config.title
    query: req.query.q
  )

module.exports = router

express = require 'express'
xmler = require 'node-xmler'

router = express.Router()

# Search
router.get '/search', (req, res) ->
  if req.query.q
    # TODO: Build query and send to BaseX REST server
    query = new xmler.Element 'query'
    text = new xmler.Element 'text', req.query.q
    query.addElement text

  res.render 'search/results', (
    title: req.config.title
    query: req.query.q
  )

module.exports = router

Add base query to send to BaseX REST server
Add base query to send to BaseX REST server

The query needs to be properly formatted to xquery, but currently
serves as an example that can be built onto.
