File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ if (fs.existsSync(process.cwd() + '/public')) {
23
23
server . use ( express . static ( path . join ( __dirname , './public' ) ) ) ;
24
24
}
25
25
26
- server . use ( cors ( ) )
26
+ server . use ( cors ( { origin : true , credentials : true } ) )
27
27
server . use ( server . router )
28
28
29
29
if ( 'development' == server . get ( 'env' ) ) {
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ describe('Server', function() {
36
36
it ( 'should respond with json and corresponding resources' , function ( done ) {
37
37
request ( server )
38
38
. get ( '/posts' )
39
+ . set ( 'Origin' , 'http://example.com' )
39
40
. expect ( 'Content-Type' , / j s o n / )
41
+ . expect ( 'Access-Control-Allow-Credentials' , 'true' )
42
+ . expect ( 'Access-Control-Allow-Origin' , 'http://example.com' )
40
43
. expect ( low . db . posts )
41
44
. expect ( 200 , done )
42
45
} )
You can’t perform that action at this time.
0 commit comments