abtmtr-comms/index.js
MeowcaTheoRange bbfd96c304 We should improve abtmtr.link site commissions somewhat.
Yet you participate in abtmtr.link site commissions. Curious!
I am very intelligent.
2024-10-11 00:02:45 -05:00

48 lines
No EOL
991 B
JavaScript

import express from "express";
import { config as dotenvConfig } from "dotenv";
import path from "path";
dotenvConfig();
const __dirname = import.meta.dirname;
const app = express();
app.set('trust proxy', true);
app.set('view engine', 'ejs');
app.use('/assets', express.static('assets'));
app.set('views', path.join(__dirname, "views", "pages"));
app.locals = {
__dirname
}
app.get('/', async (req, res) => {
res.render('index');
})
app.get('/tos', async (req, res) => {
res.render('tos');
})
app.get('/pricing', async (req, res) => {
res.render('pricing');
})
app.get('/contact', async (req, res) => {
res.render('contact');
})
app.get("/favicon.ico", (req, res) => {
res.redirect("https://cdn.abtmtr.link/site_content/favicon.ico")
})
app.all('*', (req, res) => {
res.redirect("/");
})
app.listen(process.env.PORT, () => {
const url = new URL("http://localhost/");
url.port = process.env.PORT;
console.log(`Example app listening on ${url.toString()}`);
});