Fix server

This commit is contained in:
Typicode
2014-03-26 14:12:48 +01:00
parent 84303f99ee
commit 7b5ca69ef1
2 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,4 @@
var fs = require('fs')
var express = require('express') var express = require('express')
var cors = require('cors') var cors = require('cors')
var http = require('http') var http = require('http')
@ -17,9 +18,9 @@ server.use(express.urlencoded())
server.use(express.methodOverride()) server.use(express.methodOverride())
if (fs.existsSync(process.cwd() + '/public')) { if (fs.existsSync(process.cwd() + '/public')) {
app.use(express.static(process.cwd() + '/public')); server.use(express.static(process.cwd() + '/public'));
} else { } else {
app.use(express.static(path.join(__dirname, './public'))); server.use(express.static(path.join(__dirname, './public')));
} }
server.use(cors()) server.use(cors())

View File

@ -52,7 +52,7 @@ describe('Server', function() {
}) })
}) })
describe.only('GET /:resource?_start=&_end=', function() { describe('GET /:resource?_start=&_end=', function() {
it('should respond with sliced array', function(done) { it('should respond with sliced array', function(done) {
request(server) request(server)
.get('/comments?_start=1&_end=2') .get('/comments?_start=1&_end=2')