Adding multiple urls

This commit is contained in:
Mathew Kurian 2016-02-13 16:02:16 -06:00
parent 03b20aa903
commit 6f47ef4545
2 changed files with 54 additions and 56 deletions

View file

@ -30,66 +30,62 @@
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"async": "^1.5.2", "async": "1.5.2",
"babel-runtime": "^6.3.19", "babel-runtime": "6.5.0",
"basic-auth": "^1.0.3", "basic-auth": "1.0.3",
"body-parser": "^1.14.2", "body-parser": "1.15.0",
"brace": "^0.7.0", "brace": "0.7.0",
"callsite": "^1.0.0", "callsite": "1.0.0",
"chalk": "^1.1.1", "chalk": "1.1.1",
"cssify": "^1.0.2", "express": "4.0.0",
"express": "^4.0.0",
"express-session": "^1.13.0",
"extend": "^3.0.0", "extend": "^3.0.0",
"format-error": "^1.0.0", "format-error": "^1.0.0",
"install": "^0.4.1", "jade": "1.11.0",
"jade": "^1.11.0", "json-fn": "0.60.0",
"json-fn": "^0.60.0", "keymirror": "0.1.1",
"keymirror": "^0.1.1", "minimongo": "3.8.0",
"minimongo": "^3.6.0", "moment": "2.11.2",
"moment": "^2.8.0", "mongoose": "4.4.3",
"mongoose": "^4.3.5", "nw-builder": "2.2.0",
"npm": "^3.5.3", "on-finished": "2.3.0",
"nw-builder": "^2.2.0", "rc": "1.1.6",
"on-finished": "^2.3.0", "react": "0.14.7",
"rc": "^1.1.6", "react-ace": "3.1.0",
"react": "^0.14.6", "react-datepicker": "0.22.0",
"react-ace": "^3.1.0", "react-dom": "0.14.7",
"react-datepicker": "^0.18.0", "react-influx": "1.0.8",
"react-dom": "^0.14.6", "react-list": "0.7.14",
"react-influx": "^1.0.6",
"react-list": "^0.7.11",
"react-object-inspector": "0.1.6", "react-object-inspector": "0.1.6",
"react-prefixr": "^0.1.0", "react-prefixr": "0.1.0",
"react-spinkit": "^1.1.4", "react-spinkit": "1.1.4",
"socket.io": "1.4.3", "socket.io": "1.4.3",
"strip-ansi": "^3.0.0", "strip-ansi": "3.0.0",
"superagent": "^1.6.1", "superagent": "1.7.2",
"underscore": "^1.8.3" "underscore": "1.8.3"
}, },
"readmeFilename": "README.md", "readmeFilename": "README.md",
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.3.1", "autoprefixer": "6.3.3",
"babel-preset-react": "^6.3.13", "babel-preset-react": "6.5.0",
"babelify": "^7.2.0", "babelify": "7.2.0",
"cssify": "^1.0.2", "cssify": "1.0.2",
"expect.js": "^0.3.1", "expect.js": "0.3.1",
"grunt": "^0.4.5", "grunt": "0.4.5",
"grunt-babel": "^6.0.0", "grunt-babel": "6.0.0",
"grunt-browserify": "^4.0.1", "grunt-browserify": "4.0.1",
"grunt-contrib-clean": "^0.7.0", "grunt-contrib-clean": "0.7.0",
"grunt-contrib-copy": "^0.8.2", "grunt-contrib-copy": "0.8.2",
"grunt-contrib-imagemin": "^1.0.0", "grunt-contrib-imagemin": "1.0.0",
"grunt-contrib-sass": "^0.9.2", "grunt-contrib-sass": "0.9.2",
"grunt-contrib-uglify": "^0.11.0", "grunt-contrib-uglify": "0.11.1",
"grunt-contrib-watch": "^0.6.1", "grunt-contrib-watch": "0.6.1",
"grunt-postcss": "^0.7.1", "grunt-postcss": "0.7.1",
"license-report": "^1.0.8", "license-report": "2.0.0",
"load-grunt-tasks": "^3.4.0", "load-grunt-tasks": "3.4.0",
"mocha": "^2.3.4", "mocha": "2.4.5",
"time-grunt": "^1.3.0", "time-grunt": "1.3.0",
"babel-plugin-transform-object-rest-spread": "^6.3.13", "babel-plugin-transform-object-rest-spread": "6.5.0",
"babel-plugin-transform-runtime": "^6.4.3", "babel-plugin-transform-runtime": "6.5.2",
"babel-preset-es2015": "^6.3.13" "babel-preset-es2015": "6.5.0"
} }
} }

View file

@ -2,7 +2,6 @@ import express, {Router} from 'express'
import mongoose from 'mongoose' import mongoose from 'mongoose'
import EntrySchema from '../schemas/entry' import EntrySchema from '../schemas/entry'
import jade from 'jade' import jade from 'jade'
import session from 'express-session'
import basicAuth from 'basic-auth'; import basicAuth from 'basic-auth';
import bodyParser from 'body-parser' import bodyParser from 'body-parser'
@ -70,7 +69,10 @@ export function create(mongoUri = 'mongodb://localhost/scribe', routerConfig = {
router.use(bodyParser.json()); router.use(bodyParser.json());
} }
router.get('/viewer', (req, res)=> res.send(viewer({config: JSON.stringify(clientConfig)}))); const renderViewer = (req, res)=> res.send(viewer({config: JSON.stringify(clientConfig)}));
router.get('/', renderViewer);
router.get('/viewer', renderViewer);
router.get('/rest/:collection', (req, res)=> { router.get('/rest/:collection', (req, res)=> {
if (!mongoUri) { if (!mongoUri) {