0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-04 02:02:39 -05:00

fix tests

This commit is contained in:
Alex Kocharin 2014-11-12 19:45:40 +03:00
parent 7687965219
commit c78390752a
3 changed files with 14 additions and 14 deletions

View file

@ -37,11 +37,6 @@ module.exports = function(config, auth, storage) {
})
})
app.get('/favicon.ico', function(req, res, next) {
req.url = '/-/static/favicon.png'
next()
})
// Static
app.get('/-/static/:filename', function(req, res, next) {
var file = __dirname + '/static/' + req.params.filename

View file

@ -103,13 +103,10 @@ module.exports = function(config_hash) {
app.param('org_couchdb_user', match(/^org\.couchdb\.user:/))
app.param('anything', match(/.*/))
if (config.web && config.web.enable) {
app.use(require('./index-web')(config, auth, storage))
} else {
app.get('/', function(req, res) {
res.send('Web interface is disabled in the config file')
app.get('/favicon.ico', function(req, res, next) {
req.url = '/-/static/favicon.png'
next()
})
}
/* app.get('/-/all', function(req, res) {
var https = require('https')
@ -415,7 +412,15 @@ module.exports = function(config_hash) {
res.report_error(err)
})
app.get('/*', function(req, res, next) {
if (config.web && config.web.enable) {
app.use(require('./index-web')(config, auth, storage))
} else {
app.get('/', function(req, res) {
res.send('Web interface is disabled in the config file')
})
}
app.use(function(req, res, next) {
next( Error[404]('file not found') )
})

View file

@ -1,7 +1,7 @@
describe('config.yaml', function() {
it('should be parseable', function() {
var source = require('fs').readFileSync(__dirname + '/../../lib/config_def.yaml', 'utf8')
var source = require('fs').readFileSync(__dirname + '/../../conf/default.yaml', 'utf8')
require('js-yaml').safeLoad(source)
})
})