View launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Launch Next.js", | |
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/next", | |
"runtimeArgs": ["dev"], | |
"console": "integratedTerminal", |
View server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const corsOptions = { | |
credentials: true, | |
}; | |
app.use(cors(corsOptions)); |
View server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.use(ratelimit({ | |
db, | |
duration: 60000, | |
max: 100, | |
})); |
View server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const passport = require('koa-passport'); | |
app.use(passport.initialize()); | |
app.use(passport.session()); |
View server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.use( | |
session( | |
{ | |
store: redisStore(), | |
}, | |
app, | |
), | |
); |
View Header.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { withRouter } from 'react-router'; | |
import { connect } from 'react-redux'; | |
import { NavLink } from 'react-router-dom'; | |
import get from 'lodash/get'; | |
import ProfilePlaceholder from 'assets/img/profile_placeholder.png'; | |
import { isValidURL } from 'utils/utils'; | |
import { logout, getProfile } from 'actions/access.actions'; | |
import toggleLogin from 'actions/modals.actions'; |
View routes.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Switch, Route } from 'react-router-dom'; | |
import Cookies from 'js-cookie'; | |
import { Redirect } from 'react-router'; | |
import { AsyncHomeView, AsyncAboutView } from 'asyncViews'; | |
export default function Routes() { | |
return ( | |
<Switch> |
View asyncViews.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Loadable from 'react-loadable'; | |
const Loading = () => ( | |
<div /> | |
); | |
export const AsyncAboutView = Loadable({ | |
loader: () => import('about/AboutView'), | |
loading: () => <Loading />, |
View api.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import { API_ADDRESS } from 'config'; | |
export function get(path, params) { | |
const url = `${API_ADDRESS}${path}`; | |
return axios({ | |
method: 'get', | |
url, | |
params, |
View access.reducers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cookies from 'js-cookie'; | |
import * as ActionTypes from '../constants/actionTypes'; | |
const initialState = { | |
user: { | |
isAuthenticated: typeof Cookies.get('auth__flow__spa__loggedUserObj') !== 'undefined', | |
loggedUserObj: Cookies.getJSON('auth__flow__spa__loggedUserObj'), | |
}, | |
error: null, | |
}; |
NewerOlder