Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Setting up open search

  • Loading branch information...
commit 4133d3c7b58d1fcaa5be479f5083e092328a5699 1 parent ed0756e
@beaucollins authored
Showing with 28 additions and 7 deletions.
  1. +3 −1 package.json
  2. +18 −6 server.coffee
  3. +7 −0 views/opensearch.jade
View
4 package.json
@@ -13,7 +13,9 @@
},
"dependencies": {
"express":"git://github.com/visionmedia/express.git",
- "coffee-script":"*"
+ "coffee-script":"*",
+ "consolidate":"*",
+ "jade":"*"
},
"devDependencies": {},
"optionalDependencies": {}
View
24 server.coffee
@@ -1,16 +1,25 @@
express = require 'express'
+consolidate = require 'consolidate'
http = require 'http'
https = require 'https'
url = require 'url'
app = express()
-app.use (req, res, next)->
- res.setHeader 'X-Powered-By', 'Awesomesauce'
- res.setHeader 'Server', 'Collins'
- next()
+app.configure ()->
+ # Server Headers
+ app.use (req, res, next)->
+ res.setHeader 'X-Powered-By', 'Awesomesauce'
+ res.setHeader 'Server', 'Collins'
+ next()
+
+ # Serve static files from public
+ app.use express.static('public')
+
+ app.engine 'jade', consolidate.jade
+ app.set 'view engine', 'jade'
+ app.set 'views', 'views'
-app.use express.static('public')
app.get '/supported', (req, res, next)->
find req.param('url'), req.headers['user-agent'], (e, http_response)->
@@ -18,7 +27,10 @@ app.get '/supported', (req, res, next)->
res.send(500, e.message)
else
res.send(200, {"x-frame-options":(http_response.headers['x-frame-options'] || false)})
-
+
+app.get '/opensearch', (req, res, next)->
+ res.setHeader 'content-type', 'application/opensearchdescription+xml'
+ res.render 'opensearch'
find = (u, ua, cb, hops = 5)=>
View
7 views/opensearch.jade
@@ -0,0 +1,7 @@
+doctype xml
+OpenSearchDescription(xmlns:"http://a9.com/-/spec/opensearch/1.1/")
+ ShortName Responsiv.es
+ Description Use responsiv.es to analyze your responsive CSS.
+ Tags css responsive
+ Contact beaucollins@gmail.com
+ Url(type:"text/html",template:"/?{searchTerms}")
Please sign in to comment.
Something went wrong with that request. Please try again.