-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
71 lines (55 loc) · 1.49 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var express = require("express");
var app = express();
var enforce = require('express-sslify');
// Set port
var port = process.env.PORT || 3200;
// Force ssl/https redirect
if (port !== 3200) {
app.use(enforce.HTTPS({ trustProtoHeader: true }));
}
// Set app engine + style's dir
app.set("view engine", "ejs");
app.use(express.static(__dirname + "/public"));
// ROUTES
// Landing page
app.get("/", function(req, res){
res.render("landing");
});
// Full Stack of Cards
app.get("/full-stack-cards", function(req, res){
res.render("full-stack-cards", {titleAddon: "Full Stack of Cards"});
});
// Musix App
app.get("/musix-app", function(req, res){
res.render("musix-app", {titleAddon: "Musix App"});
});
// Train Ticket
app.get("/train-ticket", function(req, res){
res.render("train-ticket", {titleAddon: "Train Ticket"});
});
// My Spirit Circle
app.get("/my-spirit-circle", function(req, res){
res.render("my-spirit-circle", {titleAddon: "My Spirit Circle"});
});
// Riley's Candles
app.get("/rileys-candles", function(req, res){
res.render("rileys-candles", {titleAddon: "Riley's Candles"});
});
// Tic Tac Toe
app.get("/tic-tac-toe", function(req, res){
res.render("tic-tac-toe");
});
// Grid Dot Game
app.get("/grid-dot-game", function(req, res){
res.render("grid-dot-game");
});
// Snek Game
app.get("/snek-game", function(req, res){
res.render("snek-game");
});
app.get("/*", function(req, res){
res.redirect("/");
});
app.listen(port, function(){
console.log(`Server running on port ${port}`);
});