Skip to content

Commit 899195b

Browse files
committed
Add check that .env exists
1 parent 6dbd529 commit 899195b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

server.js

+11
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,16 @@ if (process.env.NODE_ENV !== 'DEV') {
5050
}
5151

5252
console.log(gradient('red', 'yellow', 'green', 'blue')('-='.repeat(40)))
53+
54+
// Check that we have valid information in the .env file
55+
if (!process.env.SVGDIR) {
56+
console.log()
57+
console.log(gradient('red', 'orange', 'yellow')('ERROR: Missing SVGDIR in .env file'))
58+
console.log('Please copy over the .env.example file to .env and fill in the required information')
59+
console.log()
60+
console.log(gradient('red', 'yellow', 'green', 'blue')('-='.repeat(40)))
61+
process.exit(1)
62+
}
63+
5364
console.log('Listening on port: %s', process.env.PORT)
5465
http.createServer(app).listen(process.env.PORT)

0 commit comments

Comments
 (0)