How can I open a console to interact with my Express app?
I am trying to test whether some methods work to create a model. I'm using SequelizeJS, but that shouldn't matter for the answer to this question.
I am used to Rails where I can do $ heroku run rails console
then interact with the models in my app. I would like to do the same in Express.
To launch the REPL (Node shell), open command prompt (in Windows) or terminal (in Mac or UNIX/Linux) and type node as shown below. It will change the prompt to > in Windows and MAC. You can now test pretty much any Node.
module.exports = app
)node
, which will put you in a REPL loopvar myApp = require('./app')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With