Mflix @ localhost:5000 will not execute

I’ve updated my dotenv_win file to the below:

SECRET_KEY=kKDUK1!!h143*EEEEEEEElkemft
MFLIX_DB_URI=mongodb+srv://m220student:m220password@mflix-kpwlq.mongodb.net/test?retryWrite=true
MFLIX_NS=mflix
PORT=5000

I renamed dotenv_win to dotenv_win.env
I successfully ran npm install while in the project directory
I successfully started the application (npm start)

When I access localhost:5000 my browser I get the following npm error:
MongoParseError: URI malformed, cannot be parsed
at parseConnectionString (C:\Users\Richard\Downloads\mflix-js\node_modules\mongodb-core\lib\uri_parser.js:211:21)
at connect (C:\Users\Richard\Downloads\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:180:3)
at connectOp (C:\Users\Richard\Downloads\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:284:3)
at C:\Users\Richard\Downloads\mflix-js\node_modules\mongodb\lib\utils.js:437:24
at new Promise ()
at executeOperation (C:\Users\Richard\Downloads\mflix-js\node_modules\mongodb\lib\utils.js:432:10)
at MongoClient.connect (C:\Users\Richard\Downloads\mflix-js\node_modules\mongodb\lib\mongo_client.js:168:10)
at Function.MongoClient.connect (C:\Users\Richard\Downloads\mflix-js\node_modules\mongodb\lib\mongo_client.js:372:22)
at Object. (C:/Users/Richard/Downloads/mflix-js/src/index.js:23:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)

fyi, should be just .env, you can further double check your readme and for other things you missed

1 Like