Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Files

Latest commit

 Cannot retrieve latest commit at this time.

History

History

NestJS

README.md

nest-js

Description

Email/Calendar Microservice for HR-CRM System.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
npm run start:prod

Usage

Create an .env file with client id, client secret and redirect_uris for the app. To get those go to https://console.developers.google.com/start/api?id=gmail to create or select a project in the Google Developers Console.

CLIENT_ID=
CLIENT_SECRET=
REDIRECT_URIS=

Google Cloud Storage

  1. Google account as Developer
  2. Select or Create a Cloud Platform project
  3. Enable billing for your project
  4. Create Storage
  5. Create Bucket
  6. Enable the Google Cloud Storage API
  7. Get projectId and service-account

Using phone notifications

Login or Sign up in the https://www.nexmo.com.

Using your NEXMO API_KEY and API_SECRET, available from the dashboard getting started page, you can now send an SMS message:

curl -X "POST" "https://rest.nexmo.com/sms/json" \
   -d "from=Acme Inc" \
   -d "text=A text message sent using the Nexmo SMS API" \
   -d "to=TO_NUMBER" \
   -d "api_key=NEXMO_API_KEY" \
   -d "api_secret=NEXMO_API_SECRET"
const Nexmo = require('nexmo');

const nexmo = new Nexmo({
   apiKey: 'API_KEY',
   apiSecret: 'API_SECRET'
});

const from = 'Nexmo';
const to = 'TO_NUMBER';
const text = 'A text message sent using the Nexmo SMS API';

nexmo.message.sendSms(from, to, text, (error, response) => {
   if(error) {
     throw error;
   } else if(response.messages[0].status != '0') {
     console.error(response);
     throw 'Nexmo returned back a non-zero status';
   } else {
     console.log(response);
   }
});
You need to put API_KEY and API_SECRET to NestJS/src/Event/phone_notification/sms.js