Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
22 changes: 22 additions & 0 deletions controllers/air.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const express = require("express");
const router = express.Router();

router.get("/", (req, res) => {
// res.send("air page is working");
res.render("air.ejs", {
air:['gemini', 'libra', 'aquarius']
})
console.log("air");
})

router.get("/gemini", (req, res) => {
res.sendFile(__dirname + "/imgs/gemini.png");
})
router.get("/libra", (req, res) => {
res.sendFile(__dirname + "/imgs/libra.png");
})
router.get("/aquarius", (req, res) => {
res.sendFile(__dirname + "/imgs/aquarius.png");
})

module.exports = router;
25 changes: 25 additions & 0 deletions controllers/earth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const express = require("express");
const router = express.Router();


router.get("/", (req, res) => {
// res.send("earth page is working");
res.render("earth.ejs", {
earth: ['taurus', 'virgo', 'capricorn']
})
console.log("earth");
})

router.get("/taurus", (req, res) => {
res.sendFile(__dirname + "/imgs/taurus.png")
})
router.get("/virgo", (req, res) => {
res.sendFile(__dirname + "/imgs/virgo.png")
})
router.get("/capricorn", (req, res) => {
res.sendFile(__dirname + "/imgs/capricorn.png")
})



module.exports = router;
24 changes: 24 additions & 0 deletions controllers/fire.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const express = require("express");
const router = express.Router();

router.get("/", (req, res) => {
// res.send("fire page is working");
res.render("fire.ejs", {
fire: ['leo', 'aries', 'sagittarius']
})
console.log("fire");
})

router.get("/leo", (req, res) => {
res.sendFile(__dirname + "/imgs/leo.png")
})

router.get("/aries", (req, res) => {
res.sendFile(__dirname + "/imgs/aries.png")
})

router.get("/sagittarius", (req, res) => {
res.sendFile(__dirname +"/imgs/sagittarius.png")
})

module.exports = router;
Binary file added controllers/imgs/aquarius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/aries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/cancer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/capricorn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/gemini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/leo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/libra.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/pisces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/sagittarius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/scorpio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/taurus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added controllers/imgs/virgo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions controllers/water.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const express = require("express");
const router = express.Router();

router.get("/", (req, res) => {
// res.send("water page is working");
res.render("water.ejs", {
water: ['cancer', 'scorpio', 'pisces']
})
console.log("water");
})

router.get("/cancer", (req, res) => {
res.sendFile(__dirname + "/imgs/cancer.png");
})

router.get("/scorpio", (req, res) => {
res.sendFile(__dirname + "/imgs/scorpio.png")
})

router.get("/pisces", (req, res) => {
res.sendFile(__dirname + "/imgs/pisces.png")
})

module.exports = router;
23 changes: 23 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const express = require("express");
const app = express();
const PORT = 8000;

app.set("view engine", "ejs");
app.use(express.static("public"));

// CONTROLLERS
app.use("/air", require("./controllers/air"));
app.use("/earth", require("./controllers/earth"));
app.use("/fire", require("./controllers/fire"));
app.use("/water", require("./controllers/water"));

// ROUTES

app.get("/", (req, res) => {
// res.send("homepage is working");
res.render("index.ejs")
console.log("homepage");
})

app.listen(PORT, () =>
console.log(`Fired up from Port ${PORT} 🔓`));
Loading