vocascan / vocascan-server

Server for Vocascan
https://vocascan.com
Apache License 2.0
26 stars 5 forks source link

Feature/vocascan cli #63

Closed luwol03 closed 2 years ago

luwol03 commented 2 years ago
Status Type Env Vars Change
:white_check_mark: Ready Feature/Refactor No

Description

This Pull Request adds a CLI to manage things. I'll make the documentation for the commands ASAP. But in short, the cli can handle following things:

To develop and test this locally you can do a npm link in the root of the repo, so you are able to use the vocascan-server command. There is also a automatically generated help command from command. (vocascan-server --help)

Motivation and Context

I refactored that because now its very easy to run a vocascan server also programatically, which would help us in the future by maybe integrating a server into the desktop app to use it like a offline/no sync variant.

const runServer = require('vocascan-server');

(async () => {
  const server = await runServer({
    server: {
      port: 8989,
    },
  });

  setTimeout(() => {
    server.close();
  }, 2000);
})();

Checklist