This commit is contained in:
parent
7981d7b19c
commit
4a2ed33047
|
@ -13,7 +13,6 @@ module.exports = async (require) => {
|
|||
webApplication.set("administrator", "mailto:kill-the-newsletter@leafac.com");
|
||||
|
||||
const reverseProxy = express();
|
||||
|
||||
reverseProxy.use((req, res, next) => {
|
||||
if (req.hostname !== new URL(webApplication.get("url")).hostname)
|
||||
return res.redirect(`${webApplication.get("url")}${req.originalUrl}`);
|
||||
|
@ -30,7 +29,6 @@ module.exports = async (require) => {
|
|||
reverseProxy
|
||||
)
|
||||
.listen(443);
|
||||
|
||||
emailApplication.listen(25, () => {
|
||||
console.log("Email server started");
|
||||
});
|
||||
|
|
|
@ -520,7 +520,8 @@ export default function killTheNewsletter(
|
|||
|
||||
if (require.main === module) {
|
||||
console.log(`Kill the Newsletter!/${VERSION}`);
|
||||
const configurationFile = process.argv[2];
|
||||
const configurationFile =
|
||||
process.argv[2] === undefined ? undefined : path.resolve(process.argv[2]);
|
||||
if (configurationFile === undefined) {
|
||||
const { webApplication, emailApplication } = killTheNewsletter(
|
||||
path.join(process.cwd(), "data")
|
||||
|
@ -532,8 +533,7 @@ if (require.main === module) {
|
|||
console.log(`Email server started at ${webApplication.get("email")}`);
|
||||
});
|
||||
} else {
|
||||
const configurationFileAbsolute = path.resolve(configurationFile);
|
||||
require(configurationFileAbsolute)(require);
|
||||
console.log(`Configuration loaded from ‘${configurationFileAbsolute}’.`);
|
||||
require(configurationFile)(require);
|
||||
console.log(`Configuration loaded from ‘${configurationFile}’.`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue