mirror of
https://github.com/NotAShelf/catApi.git
synced 2024-11-22 23:50:41 +00:00
comment cleanup
This commit is contained in:
parent
73488b70e9
commit
ea9413d021
1 changed files with 4 additions and 8 deletions
12
index.js
12
index.js
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue