hiroyone / fairbinden_slack_express

Send a fairbinden lunch menu to Slack by expressjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fairbinden_slack_express

Send a fairbinden lunch menu to Slack by expressjs

Screen-Shot-2020-01-02-at-17-30-50

This program is to scrape daily lunch menu at Fairbinden blog and extract the main information to send to your Slack channel during weekdays.

Tech Stack

  • Nodejs
  • Express
  • Docker

Run the app in the Cloud Run

  1. Set up webhook channel url as export variables
NODE_ENV=PRD
WEB_HOOK_URL=https://hooks.slack.com/services/xxxxxx/xxxxx/xxxxxxxxxxxxxxxxxxxxx
CHANNEL_OFFICE_BEN=https://app.slack.com/client/xxxxxxxxxxxxxxxx
  1. Deploy the code to the Source Repository

  2. Create a service in the Cloud Run, connecting to the Source Repository

  3. Set up a cloud scheduler to trigger the function at 10 a.m. every Weekday

Run the app in the local environment

  1. Set up webhook channel url as export variables
NODE_ENV=STG
WEB_HOOK_URL=https://hooks.slack.com/services/xxxxxx/xxxxx/xxxxxxxxxxxxxxxxxxxxx
CHANNEL_OFFICE_BEN=https://app.slack.com/client/xxxxxxxxxxxxxxxx
  1. Start the app locally, using docker-compose
docker-compose up
  1. Call the app
curl -H "Content-Type: application/json" -X POST -d '{"lunchDate":"2021-04-05T11:10+09:00"}' "localhost:8080/fairbinden"

Supported Request Parameters

About

Send a fairbinden lunch menu to Slack by expressjs

License:MIT License


Languages

Language:TypeScript 79.8%Language:JavaScript 10.9%Language:Dockerfile 7.2%Language:Pug 1.6%Language:CSS 0.6%