pa11y-webservice icon indicating copy to clipboard operation
pa11y-webservice copied to clipboard

Error connecting to MongoDB

Open mgifford opened this issue 4 years ago • 2 comments

I don't think this is related to https://github.com/pa11y/pa11y-webservice/issues/115 but just wanted to link the two. Not sure why this isn't working for me.

$ PORT=8080 npm start

(node:26780) ExperimentalWarning: The fs.promises API is experimental

> [email protected] start
> node index.js

Error connecting to MongoDB:
{"name":"MongoError","message":"failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]"}

Pa11y Webservice started
mode:     undefined
uri:      http://0.0.0.0:8080
database: mongodb://localhost/pa11y-webservice
cron:     false

Error starting Pa11y Webservice:
failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]

mgifford avatar Feb 06 '21 17:02 mgifford

@mgifford,

It's in the requirements. Looks like you'll have to create a db.

Pa11y Webservice also requires a MongoDB database to be available so it can store the results of the tests. The database doesn't have to be in the same server or computer where Pa11y Webservice is running from.

owebudde avatar Mar 02 '21 19:03 owebudde

Would it be good to add an optional line in the set up to say:

Check if Mongodb is installed: npm list mongoose

If it isn't, then install it with: npm install mongodb

mgifford avatar Apr 17 '21 12:04 mgifford

Hi both, thanks for asking about this @mgifford and for your help @owebudde. There are a few different ways to set up and manage MongoDB itself - I'm not sure where mongoose would arise here, but perhaps we were using it back in 2021! I've tried to make it slightly clearer in the readme that an instance is expected to be up and running as a prerequisite.

danyalaytekin avatar Nov 08 '23 00:11 danyalaytekin