Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit b663054

Browse files
committed
move to new deployment server
1 parent 7b3c54f commit b663054

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Diff for: now.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "coderplex-app",
3+
"alias": "coderplex-app.now.sh"
4+
}

Diff for: server.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const rest = require('feathers-rest/client');
99

1010
const baseUrl =
1111
process.env.NODE_ENV === 'production' || process.env.WITH_API
12-
? `https://api.coderplex.org`
12+
? `https://coderplex.org/api`
1313
: 'http://localhost:4000';
1414

1515
const dev = process.env.NODE_ENV !== 'production';
@@ -53,14 +53,23 @@ app
5353
// Get loggedIn user
5454
server.use(async (req, res, next) => {
5555
const token = req.cookies['feathers-jwt'];
56+
console.log('****token****');
57+
console.log(token);
58+
console.log('****token****');
5659
if (!token) return next();
5760
try {
5861
const { userId } = await feathersClient.passport.verifyJWT(token);
62+
console.log('****USERID****');
63+
console.log(userId);
64+
console.log('****USERID****');
5965
req.user = await fetch(`${baseUrl}/users/${userId}`, {
6066
headers: {
6167
Authorization: `${token}`,
6268
},
6369
}).then(res => res.json());
70+
console.log('****ServerUSER****');
71+
console.log(req.user);
72+
console.log('****ServerUSER****');
6473
next();
6574
} catch (error) {
6675
console.error(error);

Diff for: utils/feathers-client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import rest from 'feathers-rest/client';
66

77
const baseUrl =
88
process.env.NODE_ENV === 'production' || process.env.WITH_API
9-
? `https://api.coderplex.org`
9+
? `https://coderplex.org/api`
1010
: 'http://localhost:4000';
1111

1212
const client = feathers();

0 commit comments

Comments
 (0)