fix forwardslash at randomImagePath

This commit is contained in:
NotAShelf 2022-01-25 16:20:32 +03:00
parent 529e570a06
commit 294c87507c
No known key found for this signature in database
GPG key ID: 2E4615E792DA9BAA

View file

@ -5,21 +5,20 @@ const fs = require('fs');
require('dotenv').config(); require('dotenv').config();
// Use tycrek's logging library for fancy messages // Use tycrek's logging library for fancy messages
const TLog = require('@tycrek/log'); // also configure the timestamps so they don't appear
const logger = new TLog(); // timestamps look ugly
const TLog = require('@tycrek/log')
const logger2 = new TLog({ const logger2 = new TLog({
timestamp: { timestamp: {
enabled: false enabled: false
} }
/* Options can be set here */
}); });
// Check if a custom port is set in .env // Check if a custom port is set in .env
// if it is, then check if a custom url is defined. Paste the correct IP:port combo or the custom url. // if it is, then check if a custom url is defined. Paste the correct IP:port combo or the custom url.
// You will need to handle domain -> raw IP redirection yourself. // You will need to handle domain -> raw IP redirection yourself.
if(process.env.PORT) { if(process.env.PORT) {
const port = process.env.PORT; const port = process.env.PORT; // Set port variable to the value in .env
logger2 logger2
.success('Custom port is set. Using custom port ' + port) .success('Custom port is set. Using custom port ' + port)
app.listen(port, () => { app.listen(port, () => {
@ -34,7 +33,7 @@ if(process.env.PORT) {
const id = path.substring(0, path.length - 4).split('-')[1]; const id = path.substring(0, path.length - 4).split('-')[1];
return { return {
id: parseInt(id), id: parseInt(id),
url: 'https://' + customurl + id, url: 'https://' + customurl + '/' + id,
}; };
} }