Richard Wen
[email protected]
Express middleware for MongoDB REST APIs
The test environment creates an isolated MongoDB database named expressmongodbrest_database
to run tests on.
To connect to MongoDB, a .env
file is required:
- Create a
.env
file in the root directory - Use the template below to provide MongoDB connection details inside the
.env
file - Ensure that
expressmongodbrest_database
does not exist (otherwise it will be dropped after tests)
MONGODB_CONNECTION=mongodb://localhost:27017
MONGODB_TESTDATABASE=expressmongodbrest_database
MONGODB_COLLECTION=rest_data
The Tests can then be run with the following command:
npm test