Managing MongoDB databases with Mongo-express

Source: Internet
Author: User

Previous words

This article will describe in detail a web-based MONGODB database management tool developed with Nodejs mongo-express

Installation

First, the global installation of the Mongo-express package

NPM install-g mongo-express

Next, use the following command to locate the Mongo-express installation directory

NPM list-g mongo-express

The output results under WIN10 are:

C:\Users\Administrator\AppData\Roaming\npm

Then go to the Node_modules/mongo-express directory under the directory, locate the Config.js file, copy the file, and name the Config.default.js file

In this way, the Config.default.js file is saved in the default configuration, while Config.js is custom configured

Configuration

Next, modify the configuration file Config.js

...if(Process.env.VCAP_SERVICES) {varDblabel ='mongodb-2.4'; varenv =Json.parse (Process.env.VCAP_SERVICES); if(Env[dblabel]) {MONGO= env[dblabel][0].credentials; }} Else{MONGO={db:'Blogs', Host:"118.1.1.1", Port:27017, SSL:false, Username:'Blogs', Password:'123456', URL:"Mongodb://118.1.1.1:27017/blogs",    //setting the connection string would only give access to that database//To see more databases your need to set Mongodb.admin to TRUE or add databases to the Mongodb.auth listConnectionString:process.env.ME_CONFIG_MONGODB_SERVER?"': Process.env.ME_CONFIG_MONGODB_URL,};} ...

Start

Because Mongo-express is a global installation, you can use the mongo-express command to start an app in any directory

Mongo-express

After the input is complete, the console outputs the following information

Mongo Express Server listening at http://localhost:8081"admin:pass"  is  This  in your config.js! Database connectedconnecting to blogs ... Database Blogs Connected

In the Address bar, enter localhost:8081, username: admin, Password: Pass verification to log in

Managing MongoDB databases with Mongo-express

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.