Handle internal APIs from web and webhooks from slack app
Clone the repo:
git clone https://github.com/shahvicky/slack-user-sync-api.git
cd slack-user-sync-api
Install dependencies
npm install
To run the app locally, you need to have docker and docker-compose installed.
Have a local setup ready by running:
npm run setup:up
This starts the dependencies (only MySQL for now) locally in docker container
To stop and remove containers created by npm run setup:up
, by running:
npm run setup:down
Start Server:
node index.js
Please see doc/env.md for the possible environment variables.
Along with the above, to run in production, you need NODE_ENV=production
and a .env
file inside tools/
dir.
For local, environment variables from local.env
inside tools/
is used
npm run test:integration
This is much faster while you are writing tests
First, start up the local env by above setup. The test a single file by:
node <path to test file>
node test/endpoint/health-check.js
To run the entire test suite:
npm run test
To include a HTML coverage report, you can run the following:
open coverage/lcov-report/index.html
- @logdna/env-config - Node.js Package to define, document, and assert environment variables
- eslint-config-logdna - This package contains the eslint configuration
- pino - Node.js logger
- express - Web framework
- @slack/web-api - Client for making requests to Slack’s Web API
SEE LICENSE IN LICENSE