GithubHelp home page GithubHelp logo

sman591 / herrd-push-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 424 KB

(inactive) Push notifications server for Discourse

License: MIT License

Shell 3.93% JavaScript 83.14% CSS 0.57% HTML 12.36%

herrd-push-server's Introduction

herrd-push-server Build Status

Push notification server for Discourse powered by Herrd

Getting Started

$ git pull [email protected]:Herrd/herrd-push-server.git
$ npm install
$ npm install -g knex
$ npm install -g bower
$ knex migrate:latest
$ bower install
$ DEBUG=herrd-push-server:* ./bin/www

If you'd like to restart the server with each file change, install nodemon:

$ npm install -g nodemon
$ DEBUG=herrd-push-server:* nodemon bin/www

Either way, the server will now be running at http://localhost:3000/.

Environment Variables

We use dotenv to simplify environment variable configuration.

To get started quickly, simply:

$ cp .env.sample .env

And update the values in .env

User Authentication

All administrative pages (such as /apps/) require authentication.

The first user can be created by going to /auth/signup. After that, the sign up page will only work for logged in users.

API Calls

Each API call requires an api_key parameter. This API key is associated directly to a Discourse forum. API results will reflect actions directly for that Discourse forum - no need to pass in the hostname each time.

GET /api/players

Lists all players associated with a Discourse forum

Parameters:
  • api_key - The API Key
Example:
$ curl https://push.herrd.io/api/players?api_key=abc123

POST /api/send

Send a notification. A notification is sent to all devices registered for the provided user.

Data:
  • api_key - The API Key
  • user_id - The Discourse user ID of who should receive the notification
  • contents - The object of contents to send

Data can be sent via JSON body or x-www-form-urlencoded

Example:
$ curl https://push.herrd.io/api/send \
   -d api_key=test \
   -d user_id=1 \
   -d contents[en]="hello world"

herrd-push-server's People

Contributors

sman591 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.