Skip to content

carvilsi/pwyll

Repository files navigation

test

pwyll

a simple snippet manager service

pwyll

This is the server side of Pwyll.

If you want to interact with pwyll, there is a cli for nodejs pwyll-cli

Run

Pwyll server needs a MongoDB connection in order to store the snippets.

Docker

No doubt about that one of the most useful ways to run it is with Docker. There is a Docker volume, so the data will be persisted.

At the devops directory, run the following command, which will start the pwyll server and MongoDB:

$ docker-compose up -d

Notice that if you are going to run this in a server with internet connectivity, you should change the configuration parameters for the MongoDB like username a password. Also most probably, you should run this with some kind of secure connection with letsencrypt.

Testing

Apart from the CI/CD configured for GitHub workflows, you can run the test locally, to do that:

  • First run the pwyll server with $ npm run build && npm start
  • Then run the tests with $ npm run dev-test this will start a dockerized MongoDB and will run the tests.

If you do not want to have Docker, then just run an instance of MongoDB locally and witht the pwyll server runinng, execute the tests with $ ./node_modules/jest/bin/jest.js --runInBand test/. Notice that the tests need to run on a clean database.


Feedback from usage and contributions are very welcome. Also if you like it, please leave a ⭐ I would appreciate it ;)