-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add index page and update workflow, search now takes params
- Loading branch information
Showing
7 changed files
with
242 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,36 @@ | ||
var path = require('path'), | ||
express = require('express'), | ||
config = require('./config'); | ||
bodyParser = require('body-parser'), | ||
express = require('express'), | ||
config = require('./config'); | ||
|
||
var app = express(); | ||
|
||
app.use(express.static('public')); | ||
app.use('/bower_components', express.static(__dirname + '/bower_components')); | ||
app.use('/bower_components', express.static(__dirname + '/bower_components')); | ||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({ | ||
extended: true | ||
})); | ||
|
||
app.set('view engine', 'pug'); | ||
app.set('views', path.resolve('public/views')); | ||
|
||
app.get('/', function (req, res) { | ||
res.render('iconic', { | ||
config: JSON.stringify(config) | ||
app.get('/', function(req, res) { | ||
res.render('index'); | ||
}); | ||
|
||
app.get('/search/:loc', function(req, res) { | ||
var position = null; | ||
if (req.params.loc) { | ||
// verify min format | ||
position = req.params.loc.split(','); | ||
} | ||
res.render('default', { | ||
config: JSON.stringify(config), | ||
position: position | ||
}); | ||
}); | ||
|
||
app.listen(process.env.PORT || 3000, function () { | ||
app.listen(process.env.PORT || 3000, function() { | ||
console.log('Example app listening on port 3000!'); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.