add login route

This commit is contained in:
catarak 2016-05-24 01:20:59 -04:00
parent 16abc8d725
commit c22ae1724a
3 changed files with 20 additions and 0 deletions

View file

@ -49,6 +49,9 @@ const passportConfig = require('./config/passport');
app.get("/", function(req, res) { app.get("/", function(req, res) {
res.sendFile(path.resolve(__dirname + '/../index.html')); res.sendFile(path.resolve(__dirname + '/../index.html'));
}) })
app.get("/login", function(req, res) {
res.sendFile(path.resolve(__dirname + '/../index.html'));
})
// start app // start app
app.listen(serverConfig.port, (error) => { app.listen(serverConfig.port, (error) => {

View file

@ -0,0 +1,15 @@
import React from 'react'
class LoginView extends React.Component {
render() {
return (
<form>
<input type="text" placeholder="Username or email"/>
<input type="password" placeholder="Password"/>
<input type="submit" value="Log In" />
</form>
)
}
}
export default LoginView;

View file

@ -2,10 +2,12 @@ import { Route, IndexRoute } from 'react-router'
import React from 'react' import React from 'react'
import App from './containers/App' import App from './containers/App'
import IDEView from './containers/IDEView/IDEView' import IDEView from './containers/IDEView/IDEView'
import LoginView from './containers/LoginView/LoginView'
const routes = ( const routes = (
<Route path="/" component={App}> <Route path="/" component={App}>
<IndexRoute component={IDEView} /> <IndexRoute component={IDEView} />
<Route path="/login" component={LoginView}/>
</Route> </Route>
); );