Skip to content

Commit 4012846

Browse files
notrabdougwilson
authored andcommitted
examples: use static assets in search example
closes #3224
1 parent 6d9b127 commit 4012846

File tree

4 files changed

+21
-25
lines changed

4 files changed

+21
-25
lines changed

examples/search/index.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ var db = redis.createClient();
1515

1616
var app = express();
1717

18-
app.set('view engine', 'jade');
19-
app.set('views', __dirname);
18+
app.use(express.static(__dirname + '/public'));
2019

2120
// populate search
2221

@@ -26,14 +25,6 @@ db.sadd('ferret', 'jane');
2625
db.sadd('cat', 'manny');
2726
db.sadd('cat', 'luna');
2827

29-
/**
30-
* GET the search page.
31-
*/
32-
33-
app.get('/', function(req, res){
34-
res.render('search');
35-
});
36-
3728
/**
3829
* GET search for :query.
3930
*/
File renamed without changes.

examples/search/public/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Search example</title>
6+
<style type="text/css">
7+
body {
8+
font: 14px "Helvetica Neue", Helvetica;
9+
padding: 50px;
10+
}
11+
</style>
12+
</head>
13+
<body>
14+
<h2>Search</h2>
15+
<p>Try searching for "ferret" or "cat".</p>
16+
<input type="search" name="search" value="" />
17+
<pre />
18+
<script src="/client.js" charset="utf-8"></script>
19+
</body>
20+
</html>

examples/search/search.jade

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)