Skip to content

🤖 Broadcast a dad joke to a Telegram channel

Notifications You must be signed in to change notification settings

jsstrn/daily-dad-jokes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Daily Dad Jokes

Development

Install Serverless CLI

curl -o- -L https://slss.io/install | bash

Install dependencies

npm install

Deployment

To deploy (defaults to development stage)

npm run deploy

To deploy to production

npm run deploy:prod

Alternatively, you can set the stage property in serverless.yml. By default, stage is set to dev.

Environment variables

For development, create a .env file and add your environment variables.

For production, create a env.prod file and add your environment variables.

Environment variables are handled by serverless-dotenv-plugin. See example usage.

Webhooks

When we first deploy to an environment, we must setup a webhook so that Telegram knows where to send bot requests to. This is a one time setup.

Scheduling

We use AWS EventBridge to trigger our functions. Note that AWS EventBridge does not use the standard cron format so you cannot rely on online cron editors. Instead refer to their documentation for cron and rate expressions.

Configure Serverless

To configure your Serverless project you need to include a serverless.yml file. For more information, see this reference.

Plugins for Serverless

View all available plugins.

Development checklist

  • Programmatically set environment variables
  • Prune older deployment versions
  • Add Prettier code formatter
  • Use different schedules for each stage
  • Add Webpack
  • Add ESLint
  • Rewrite code for TypeScript
  • Add TSLint

About

🤖 Broadcast a dad joke to a Telegram channel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published