An API for sending sign-on/sign-off messages to Slack.
This project uses Node 6+ and yarn - so if you're missing either of those things you'll need to install them.
- Clone this repository
- Fetch dependencies with
yarn
$ git clone https://github.com/kpollich/shift-hello-api.git
$ cd shift-hello-api
$ yarn# Start the API server
$ yarn start
# Start the API server in dev mode - with auto-reloading on file change via `nodemon`
$ yarn start-dev
# Run the Jest test suite
$ yarn test
# Run tests in `watch` mode - tests will re-run on file change
$ yarn test --watchThere are only two routes exposed by this API, both unauthenticated (for now!): /sign-in and /sign-out.
Send a random Slack sign-on message on behalf of the provided name. Responds with an empty bodied 200 on success, or an error object on failure.
POST /sign-in
{
"name": "John Doe"
}Send a random Slack sign-off message on behalf of the provided name. Responds with an empty bodied 200 on success, or an error object on failure.
POST /sign-out
{
"name": "John Doe"
}This app is a fairly straightforward Node API and uses some modern JavaScript tooling. If you're unfamiliar with some of the things going on here, check out of the libraries and plugins we're using below.
The app itself is a fairly light Express API serving a few routes. Tests are written using Jest, Sinon, and SuperTest. We maintain code style and conventions with Prettier, ESLint, and EditorConfig. A pre-commit git hook through Husky reformats your code before you commit it so we don't run into style conflicts.