Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wip

  • Loading branch information...
commit 3c3d4c39e5ff638e09343a251ad5ec4221b19b69 1 parent 90f52a3
@isaacs isaacs authored
Showing with 22 additions and 0 deletions.
  1. +8 −0 models/search.js
  2. +14 −0 routes/search.js
View
8 models/search.js
@@ -0,0 +1,8 @@
+module.exports = search
+
+var LRU = require('lru-cache')
+, regData = new LRU(100)
+, npm = require('npm')
+
+function search (query, cb) {
+ if (typeof query !== 'string')
View
14 routes/search.js
@@ -0,0 +1,14 @@
+module.exports = search
+
+function search (req, res) {
+ req.model.load('profile', req)
+ req.model.load('search', req.query.q)
+ req.model.end(function (er, m) {
+ if (er) return res.error(er)
+ var locals = {
+ results: m.search,
+ profile: m.profile
+ };
+ return res.template('search.ejs', {})
+ })
+}
Please sign in to comment.
Something went wrong with that request. Please try again.