Issue
The getting started page for the Express application generator (located here) says to start the server by using $ DEBUG=myapp:* npm start
if using MacOS or Linux.
This works fine, but I'm having trouble understanding what this line is actually doing. I would have guessed that it would be assigning something to the variable DEBUG
, but after exiting the server I ran echo $DEBUG
and it printed nothing. I'm guessing the :
is somehow key here, but it's not clear to me how/why.
Hopefully someone can break this down for me.
Solution
It turns out I was thinking that this was far more complicated than it actually is. Chepner's answer got some gears unstuck in my head.
I created a python script that prints the DEBUG
variable and called it instead of npm start
$ DEBUG=myapp:* python printvar.py
Sure enough, this printed myapp:*
. It seems the big piece that I was missing was that the space after the variable assignment is used as a separator between the commands and the :*
is nothing more than text that's part of the variable that gets assigned to DEBUG
.
Answered By - Pak Answer Checked By - Mary Flores (WPSolving Volunteer)