comment cleanup

This commit is contained in:
NotAShelf 2022-01-25 16:27:18 +03:00
parent 73488b70e9
commit ea9413d021
No known key found for this signature in database
GPG key ID: 2E4615E792DA9BAA

View file

@ -61,7 +61,8 @@ if(process.env.PORT) {
} }
else { else {
logger2 logger2
.error('Custom URL not defined. Falling back to http://localhost:' + port) .error('Custom URL not defined. Falling back to localhost')
.info('App listening at http://localhost:' + port)
.comment('Godspeed, little fella!') .comment('Godspeed, little fella!')
const getRandomImageApi = () => { const getRandomImageApi = () => {
const path = getRandomImagePath(); const path = getRandomImagePath();
@ -99,7 +100,7 @@ else {
app.listen(port, () => { app.listen(port, () => {
if(process.env.CUSTOMURL) { if(process.env.CUSTOMURL) {
logger2 logger2
.success('Custom URL defined. Using custom url ' + customurl + '\n(Hope you have configured a reverse proxy.)') .success('Custom URL defined. Using custom url ' + customurl)
.success('App listening at ' + 'https://' + customurl); .success('App listening at ' + 'https://' + customurl);
console.log('Godspeed, little fella!'); console.log('Godspeed, little fella!');
const getRandomImageApi = () => { const getRandomImageApi = () => {
@ -117,7 +118,7 @@ else {
} }
else { else {
logger2 logger2
.error('Custom URL not defined. Falling back to http://localhost:' + port) .error('Custom URL not defined. Falling back to localhost')
.info('App listening at ' + 'http://localhost:' + port) .info('App listening at ' + 'http://localhost:' + port)
.comment('Godspeed, little fella!') .comment('Godspeed, little fella!')
const getRandomImageApi = () => { const getRandomImageApi = () => {
@ -137,11 +138,6 @@ else {
}); });
} }
// Check if a custom port is set in .env
// if it is, then check if a custom url is defined.
// Makes sure API routes are configured correctly.
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.sendFile(getRandomImagePath(), (err) => { res.sendFile(getRandomImagePath(), (err) => {
if (err) { if (err) {