diff --git a/src/components/Login.js b/src/components/Login.js
index ed5baa75..061aa18c 100644
--- a/src/components/Login.js
+++ b/src/components/Login.js
@@ -1,22 +1,32 @@
import React from 'react';
import './Login.css';
+import Request from 'request';
export default class Login extends React.Component {
constructor(props) {
super(props);
- this.state = {team:null};
+ this.state = { team: null, serverResponse: false };
this.handleChange = this.handleChange.bind(this);
}
- handleChange(event) {
- this.setState({team: event.target.value});
- };
+ handleChange = (e) => {
+ this.setState({ team: e.target.value });
+ }
render() {
+ const validateLogInFromServer = (team, pass) => {
+ Request.post({url: "http://localhost:8080/login", form:{text:"hi"}}, (err, res, body) => {
+ if (err) {
+ return (
{err}
);
+ } else {
+ return (
{body}
);
+ }
+ });
+ }
return (
-
{this.props.loggedIn} is logged in.
+
{this.props.loggedIn ? this.props.teamLoggedIn : "no team"} is logged in.
-
+
)
}
diff --git a/src/server.js b/src/server.js
index e9100211..1d1a369d 100644
--- a/src/server.js
+++ b/src/server.js
@@ -11,4 +11,8 @@ app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, '..', 'build', 'index.html'));
});
+app.get('/login', function (req, res) {
+ console.log(req.text);
+})
+
app.listen(PORT);
\ No newline at end of file