Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Commit

Permalink
feat: Add an express app tha redirects to the slack invite url.
Browse files Browse the repository at this point in the history
  • Loading branch information
Feanil Patel committed Jul 11, 2022
1 parent e5bb319 commit 4769060
Show file tree
Hide file tree
Showing 9 changed files with 1,404 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
node_modules/
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
786 changes: 786 additions & 0 deletions .yarn/releases/yarn-3.2.1.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-3.2.1.cjs
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: yarn start
47 changes: 47 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
openedx-slack-invite
####################

This app used to be a slack invite app based on
https://github.com/outsideris/slack-invite-automation

We've now replaced it with a simple redirect app to the slack invite link.

We're still keeping the app around incase the old heroku URL was hardcoded in
more places. If it's been more than a year since July 2022 this repo and the
corresponding herokuapp can both be archived.

See https://github.com/openedx/tcril-engineering/issues/346 for more info.

Getting Started
***************

Local Development
=================

.. code::
git clone git@github.com:openedx/openedx-slack-invite
cd openedx-slack-invite
yarn install # Install the dependencies
yarn run start # Start the server.
The entire app is in the app.js file so edit that if you need to change
anything.

Deploying to Heroku
===================

One Time Setup
--------------

.. code::
heroku config:set REDIRECT_URL="path/to/slack/invite/url"
For Each Deploy
---------------

.. code::
git push heroku master
heroku logs -a openedx-slack-invite -t # tail the logs
12 changes: 12 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const express = require('express')
const app = express()
const port = process.env.PORT || 3000
const redirect_url = process.env.REDIRECT_URL || "https://example.com"

app.get('/', (req, res) => {
res.redirect(redirect_url)
})

app.listen(port, () => {
console.log(`Redirect app listening on port ${port}`)
})
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "openedx-slack-invite",
"packageManager": "yarn@3.2.1",
"dependencies": {
"express": "^4.18.1"
},
"scripts": {
"start": "node app.js"
}
}
Loading

0 comments on commit 4769060

Please sign in to comment.