Skip to content

kpollich/shift-hello-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shift-hello-api

Build Status

An API for sending sign-on/sign-off messages to Slack.

Installation

This project uses Node 6+ and yarn - so if you're missing either of those things you'll need to install them.

  1. Clone this repository
  2. Fetch dependencies with yarn
$ git clone https://github.com/kpollich/shift-hello-api.git
$ cd shift-hello-api
$ yarn

Usage

# 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 --watch

API

There are only two routes exposed by this API, both unauthenticated (for now!): /sign-in and /sign-out.

Sign In

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"
}

Sign Out

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"
}

Tech Rundown

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.

About

An API for automating Slack messages and more

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors