Skip to content

Commit

Permalink
moving on
Browse files Browse the repository at this point in the history
  • Loading branch information
chi_Script committed Jul 30, 2018
1 parent e7b97bf commit 4c7d271
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
12 changes: 6 additions & 6 deletions controllers/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
jwtSecret: "s3cr3t3duT0rchdiz@bl3d",
jwtSession: {
session: false
}
};
// module.exports = {
// jwtSecret: "s3cr3t3duT0rchdiz@bl3d",
// jwtSession: {
// session: false
// }
// };
1 change: 0 additions & 1 deletion model/model.js

This file was deleted.

17 changes: 5 additions & 12 deletions routes/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const app = Router()
// Task1 begins here

app.get('/', (req, res) => {
res.status(200).json({ status: 'success'});
if(req) {
return res.status(200).json({ status: 'success'});
}
return res.status(404).json({ status: 'unsuccessful'})
});

let data = []
Expand Down Expand Up @@ -56,17 +59,7 @@ app.post('/login', passport.authenticate('local'), function (req, res) {
})
})

// app.get('/profile', passport.authenticate('local', {
// session: false
// }), (req, res) => {
// res.json({
// user: user.req
// });
// });
// app.get('/logout', (req, res) => {
// req.logout();
// res.redirect('/');
// })


module.exports = app

Expand Down
12 changes: 11 additions & 1 deletion test/api/serverTest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ describe('API Routes', () => {
done();
});
});
it('should return a 404 response', done => {
chai
.request('http://localhost:5000')
.get('/not home')
.end((err, res) => {
res.should.have.status(404);
res.body.should.be.a('object');
done();
});
});
});

describe('GET /data', () => {
it('should return a response of 200', done => {
it('should return a response of 404', done => {
chai
.request('http://localhost:5000')
.get('/data')
Expand Down

0 comments on commit 4c7d271

Please sign in to comment.