diff --git a/src/app.js b/src/app.js
index 5f4ddba..74ff019 100644
--- a/src/app.js
+++ b/src/app.js
@@ -7,8 +7,9 @@ var io = require('socket.io')(http);
const cookieParser = require('cookie-parser');
app.use(cookieParser());
+// bootstrap
app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css'));
-app.use(express.static('public'));
+// app.use(express.static('public'));
const routes = require(__dirname + '/routes');
app.use("/", routes);
diff --git a/src/controllers/main.js b/src/controllers/main.js
index 8360cdc..e225050 100644
--- a/src/controllers/main.js
+++ b/src/controllers/main.js
@@ -1,9 +1,14 @@
+const path = require('path');
const mainController = {
root: (req, res) => {
- res.json({
- message: "Hello, World!",
- });
+ res.sendFile(path.resolve(__dirname + '/../public/index.html'));
+ },
+ style: (req, res) => {
+ res.sendFile(path.resolve(__dirname + '/../public/style.css'));
+ },
+ script: (req, res) => {
+ res.sendFile(path.resolve(__dirname + '/../public/script.js'));
}
};
diff --git a/src/public/index.html b/src/public/index.html
index 7cfa939..8e0a5ea 100644
--- a/src/public/index.html
+++ b/src/public/index.html
@@ -4,7 +4,7 @@
-
+
diff --git a/src/routes/root.js b/src/routes/root.js
index 86189bf..3e2cbb7 100644
--- a/src/routes/root.js
+++ b/src/routes/root.js
@@ -6,4 +6,12 @@ router
.route("/")
.get(mainController.root);
+router
+ .route("/style.css")
+ .get(mainController.style);
+
+router
+ .route("/script.js")
+ .get(mainController.script);
+
module.exports = router;