add 909 stems and remake social links
This commit is contained in:
parent
b053ac4eaa
commit
cec146aefe
4 changed files with 45 additions and 34 deletions
BIN
assets/files/909_(overdrive)_STEMS.zip
Normal file
BIN
assets/files/909_(overdrive)_STEMS.zip
Normal file
Binary file not shown.
23
constants.js
23
constants.js
|
@ -1,12 +1,17 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'ABISU',
|
name: "ABISU",
|
||||||
socials: {
|
|
||||||
bandcamp: "https://abisu.bandcamp.com/",
|
socials: [
|
||||||
twitter: "https://twitter.com/abisoos",
|
{ links: ["/bandcamp", "/bc"], link: "https://abisu.bandcamp.com/" },
|
||||||
soundcloud: "https://soundcloud.com/abisoos",
|
{ links: ["/twitter"], link: "https://twitter.com/abisoos" },
|
||||||
spotify: "https://open.spotify.com/artist/4AjMDVVo5Hh1UJ5emUgX5s?si=Fii2vRh3TrGTpjTKMbuyhQ"
|
{ links: ["/soundcloud", "/sc"], link: "https://soundcloud.com/abisoos" },
|
||||||
},
|
{
|
||||||
|
links: ["/spotify"],
|
||||||
|
link:
|
||||||
|
"https://open.spotify.com/artist/4AjMDVVo5Hh1UJ5emUgX5s?si=Fii2vRh3TrGTpjTKMbuyhQ",
|
||||||
|
},
|
||||||
|
],
|
||||||
music: {
|
music: {
|
||||||
overdrive: "https://soundcloud.com/abisoos/overdrive"
|
overdrive: "https://soundcloud.com/abisoos/overdrive",
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
0
run.sh
Executable file → Normal file
0
run.sh
Executable file → Normal file
52
server.js
52
server.js
|
@ -7,7 +7,7 @@ const morgan = require("morgan");
|
||||||
const chalk = require("chalk");
|
const chalk = require("chalk");
|
||||||
const hbs = require("express-handlebars");
|
const hbs = require("express-handlebars");
|
||||||
let { port, hostname } = {
|
let { port, hostname } = {
|
||||||
port: 48114
|
port: 48114,
|
||||||
};
|
};
|
||||||
const con = require("./constants");
|
const con = require("./constants");
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ app.engine(
|
||||||
"hbs",
|
"hbs",
|
||||||
hbs({
|
hbs({
|
||||||
extname: "hbs",
|
extname: "hbs",
|
||||||
defaultView: "default"
|
defaultView: "default",
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ app.use("/assets", express.static("./assets"));
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(
|
app.use(
|
||||||
express.urlencoded({
|
express.urlencoded({
|
||||||
extended: true
|
extended: true,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
|
@ -41,7 +41,7 @@ app.use(
|
||||||
chalk.hex("#ffb142").bold(tokens.status(req, res)),
|
chalk.hex("#ffb142").bold(tokens.status(req, res)),
|
||||||
chalk.hex("#ff5252").bold(req.hostname + tokens.url(req, res)),
|
chalk.hex("#ff5252").bold(req.hostname + tokens.url(req, res)),
|
||||||
chalk.hex("#2ed573").bold(tokens["response-time"](req, res) + "ms"),
|
chalk.hex("#2ed573").bold(tokens["response-time"](req, res) + "ms"),
|
||||||
chalk.hex("#f78fb3").bold("@ " + tokens.date(req, res))
|
chalk.hex("#f78fb3").bold("@ " + tokens.date(req, res)),
|
||||||
].join(" ");
|
].join(" ");
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -51,7 +51,7 @@ function breakSocials(social) {
|
||||||
return social.split("");
|
return social.split("");
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = async => {
|
module.exports = (async) => {
|
||||||
app.get("/", async (req, res) => {
|
app.get("/", async (req, res) => {
|
||||||
res.render("index", {
|
res.render("index", {
|
||||||
layout: "main",
|
layout: "main",
|
||||||
|
@ -61,40 +61,47 @@ module.exports = async => {
|
||||||
{
|
{
|
||||||
name: "Twitter",
|
name: "Twitter",
|
||||||
link: "abisu.net/twitter",
|
link: "abisu.net/twitter",
|
||||||
character: breakSocials("Twitter")
|
character: breakSocials("Twitter"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Spotify",
|
name: "Spotify",
|
||||||
link: "abisu.net/spotify",
|
link: "abisu.net/spotify",
|
||||||
character: breakSocials("Spotify")
|
character: breakSocials("Spotify"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Soundcloud",
|
name: "Soundcloud",
|
||||||
link: "abisu.net/soundcloud",
|
link: "abisu.net/soundcloud",
|
||||||
character: breakSocials("Soundcloud")
|
character: breakSocials("Soundcloud"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Bandcamp",
|
name: "Bandcamp",
|
||||||
link: "abisu.net/bandcamp",
|
link: "abisu.net/bandcamp",
|
||||||
character: breakSocials("Bandcamp")
|
character: breakSocials("Bandcamp"),
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
con.socials.forEach((social) => {
|
||||||
|
app.get(social.links, (req, res) => {
|
||||||
|
res.redirect(social.link);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Socials
|
// ! STEMS
|
||||||
app.get("/spotify", (req, res) => {
|
|
||||||
res.redirect(con.socials.spotify);
|
app.get("/stems/:stem", async (req, res) => {
|
||||||
});
|
switch (req.params.stem) {
|
||||||
app.get("/twitter", (req, res) => {
|
case "overdrive":
|
||||||
res.redirect(con.socials.twitter);
|
case "909":
|
||||||
});
|
return res.download(
|
||||||
app.get(["/bandcamp", "/bc"], (req, res) => {
|
"./assets/files/909_(overdrive)_STEMS.zip",
|
||||||
res.redirect(con.socials.bandcamp);
|
"909_Overdrive_Stems.zip"
|
||||||
});
|
);
|
||||||
app.get(["/soundcloud", "/sc"], (req, res) => {
|
|
||||||
res.redirect(con.socials.soundcloud);
|
default:
|
||||||
|
return res.redirect("/");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Music
|
// Music
|
||||||
|
@ -102,7 +109,6 @@ module.exports = async => {
|
||||||
res.redirect(con.music.overdrive);
|
res.redirect(con.music.overdrive);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
app.listen(port /* , hostname */, () => {
|
app.listen(port /* , hostname */, () => {
|
||||||
console.log(`[ Server ] Listening on ${port}`);
|
console.log(`[ Server ] Listening on ${port}`);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue