Basic example of browser calls.
Possible to create an example with only what is required to make a browser call (without all the mongo and other stuff)?
To eliminate the MongoDB requirement, as a hacky fix, you can edit this line of bin/www to change it to:
const { MongoMemoryServer } = require('mongodb-memory-server');
const mongod = new MongoMemoryServer();
const mongooseOpts = {
useNewUrlParser: true,
useUnifiedTopology: true
};
(async () => await mongoose.connect(await mongod.getConnectionString(), mongooseOpts))();
This seems to work for me.
You'll notice that this lets the server start possibly before the database is initialized. This is an issue with the existing code: It doesn't await the DB start, but it likely won't be an issue in testing.
This code is pretty much copied from the unit test, so it seems like a 5-minute task to make a config option to use an in-memory DB.
Overall, the demo looks really nice and fancy, but it would be far easier to understand a quick demo than a more involved one like this with application logic on top of it. Just a simple HTML page with no CSS would do.