Skip to content

Commit

Permalink
Merge pull request #31 from petercort/updating-webhooks
Browse files Browse the repository at this point in the history
updating the webhook with more verboseness
  • Loading branch information
petercort authored Jan 11, 2025
2 parents 855b1e2 + cc9a1fe commit 1fcb3be
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog


### Version 1.3.0

#### chore
* PR [#31](https://github.com/petercort/FBF-Buddy/pull/31) - updating the webhook with more verboseness



### Version 1.2.1

#### bugfix
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ Changes should be made to the readme-template.yml file and the generate-readme.j

A discord app that helps with random tasks in the FBF discord!

| Command | Inputs | Description | Example | Output |
| ------- | ------ | ----------- | ------- | ------ |
| /connect_strava | None | User authorizes access to the Strava app to collect information about your bikes. Permissions: scope=read, activity:read_all, profile:read_all | /connect_strava | A link to connect to Strava |
| /sync_bikes | None | Syncs bike data from Strava. | /sync_bikes | Returns bike data in the format Name (Brand, Model, Mileage) |
| /get_all_bikes | None | Gets all your bike data from Strava | /get_all_bikes | Returns bike data in the format Name (Brand, Model) |
| /get_bike_by_name | name | Returns specific details about a bike | /get_bike_by_name name: Joe | Returns more bike data in the format name, brand, model, current mileage, and last waxed (date + mileage) |
| /i_waxed_my_chain | bike_name (req) date (optional) mileage (optional) | Updated the last_waxed field on the app. With no optional params passed it will update to the current date and mileage. | /i_waxed_my_chain bike_name: Joe date: 12/24/2024 mileage: 355 | If successful, returns the date and mileage in the system for a last wax, otherwise returns an error. |
| /get_last_ride | none | Returns the last ride you did according to Strava | /get_last_ride | Returns info on the last ride you did. |

## Known Issues
- No known issues

Expand Down
2 changes: 1 addition & 1 deletion app.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.3.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fbf-buddy",
"private": true,
"version": "1.2.1",
"version": "1.3.0",
"description": "Cycling event app for Discord",
"main": "app.js",
"engines": {
Expand Down
8 changes: 6 additions & 2 deletions src/strava_webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ app.post('/webhook', async (req, res) => {

// Adds support for GET requests to our webhook
app.get('/webhook', (req, res) => {
// Your verify token. Should be a random string.
const VERIFY_TOKEN = "STRAVA";
console.log('GET request received');
// Your verify token. Should be a random string. should really hide this
const VERIFY_TOKEN = "spBoS8Zx9oSwZTaW";
// Parses the query params
let mode = req.query['hub.mode'];
let token = req.query['hub.verify_token'];
Expand All @@ -90,6 +91,9 @@ app.get('/webhook', (req, res) => {
// Responds with '403 Forbidden' if verify tokens do not match
res.sendStatus(403);
}
} else {
console.log("No token or mode found in query string");
res.status(500).send('No token or mode found in query string');
}
});

Expand Down

0 comments on commit 1fcb3be

Please sign in to comment.