This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add an express app tha redirects to the slack invite url.
- Loading branch information
Feanil Patel
committed
Jul 11, 2022
1 parent
e5bb319
commit 4769060
Showing
9 changed files
with
1,404 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarnPath: .yarn/releases/yarn-3.2.1.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: yarn start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Oops, something went wrong.