Reputation: 1348
In adonisjS, they have this folder callded commands
where all files can be executed only at the command line, and it's connected to their api and mongoose, like for example, I want to find all the users, I just need to use User.find()
and run the command as adonis find-user
to execute the command and find all the users, My question is, what is the alternative of this function for expressjs? I can't seem to create a command that is connected to my server.
Here's the example of my code on adonisJS that can run commands that is connected on my mongodb database setted up on my server
[
Upvotes: 0
Views: 155
Reputation: 3640
ExpressJS has no default database layer. You can write your own commands (node scripts) but they must connect manually to the database.
Upvotes: 1