diff --git a/backend/apis/nodejs/api.js b/backend/apis/nodejs/api.js index 88b71e2..fa62a08 100644 --- a/backend/apis/nodejs/api.js +++ b/backend/apis/nodejs/api.js @@ -12,11 +12,14 @@ */ const express = require('express'); +const cors = require('cors'); const api_controller = require('./api_controller.js'); require('dotenv').config(); const app = express(); app.use(express.json()); // Middleware which parses JSON for POST requests +// Enable CORS for all routes +app.use(cors()); app.post('/blinkapi/register', api_controller.registerPerson); // Register a Person app.post('/blinkapi/login', api_controller.login); // Login app.get('/blinkapi/person/:id', api_controller.verifyToken, api_controller.getPerson); // Obtain Person's details diff --git a/frontend/html/constants.js b/frontend/html/constants.js new file mode 100644 index 0000000..06efcb3 --- /dev/null +++ b/frontend/html/constants.js @@ -0,0 +1 @@ +const apiUrl = "http://localhost:3000/blinkapi"; \ No newline at end of file diff --git a/frontend/html/css/login.css b/frontend/html/css/login-register.css similarity index 97% rename from frontend/html/css/login.css rename to frontend/html/css/login-register.css index 7cce9d5..2d8fa7c 100644 --- a/frontend/html/css/login.css +++ b/frontend/html/css/login-register.css @@ -48,7 +48,7 @@ a:active:hover { padding: 0 60px; } -input { +input, button { display: block; box-sizing: border-box; width: 100%; @@ -130,7 +130,7 @@ input[type="email"]:valid ~ .validation span:last-child { top: 0px; } -input[type="submit"] { +button[type="button"] { border: none; display: block; background-color: #3ca9e2; @@ -146,7 +146,7 @@ input[type="submit"] { cursor: pointer; text-align: center; } -input[type="submit"]:hover { +button[type="button"]:hover { background-color: #329dd5; -webkit-transition: all 0.2s ease; transition: all 0.2s ease; diff --git a/frontend/html/html/login.html b/frontend/html/html/login.html index 2af5964..0fac469 100644 --- a/frontend/html/html/login.html +++ b/frontend/html/html/login.html @@ -4,7 +4,7 @@
Already a member? Login
+