Dylan
Dylan

Reputation: 1348

What is alternative of adonisJS commands function to expressJS

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

[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[1]

Upvotes: 0

Views: 155

Answers (1)

Capi Etheriel
Capi Etheriel

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

Related Questions