mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
use __ prefix for api because it isn't cached by default with create-react-app
This commit is contained in:
9
app.js
9
app.js
@@ -37,12 +37,15 @@ const passport = require('./config/passport');
|
||||
|
||||
app.use(passport.initialize());
|
||||
|
||||
app.use('/api/users', require('./routes/users'));
|
||||
// Addresses, starting with /__, are not cached by service worker
|
||||
// https://github.com/facebook/create-react-app/issues/2237
|
||||
|
||||
app.use('/__/users', require('./routes/users'));
|
||||
|
||||
const auth = require('./routes/auth');
|
||||
|
||||
app.use('/api/lists', auth.required, require('./routes/lists'));
|
||||
app.use('/api/todos', auth.required, require('./routes/todos'));
|
||||
app.use('/__/lists', auth.required, require('./routes/lists'));
|
||||
app.use('/__/todos', auth.required, require('./routes/todos'));
|
||||
|
||||
if (
|
||||
process.env.NODE_ENV === 'production' ||
|
||||
|
||||
@@ -14,7 +14,7 @@ const production = {
|
||||
googleEnabled: process.env.GOOGLE_ENABLED,
|
||||
googleClientId: process.env.GOOGLE_CLIENT_ID,
|
||||
googleClientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
||||
googleCallback: `${process.env.HOST}/api/users/login/google/callback`,
|
||||
googleCallback: `${process.env.HOST}/__/users/login/google/callback`,
|
||||
},
|
||||
secret: process.env.SECRET,
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export const API_ROOT = '/api';
|
||||
export const API_ROOT = '/__';
|
||||
|
||||
let token = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user