Skip to content

Commit

Permalink
refactor: rename twitter into x
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jun 6, 2024
1 parent 14449d1 commit 63a2013
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ kill_timeout = 5
type = "requests"
soft_limit = 3
hard_limit = 5

[[restart]]
policy = "on-failure"
max_retries = 5
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ const router = createRouter((error, _, res) => {

router
.use(
(req, _, next) => {
(req, res, next) => {
if (req.url.startsWith('/twitter')) {
res.writeHead(301, { Location: req.url.replace('/twitter', '/x') })
res.end()
}
req.ipAddress = req.headers['cf-connecting-ip'] || '::ffff:127.0.0.1'
next()
},
Expand Down
2 changes: 1 addition & 1 deletion src/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const providers = {
telegram: require('./telegram'),
// tiktok: require('./tiktok'),
twitch: require('./twitch'),
twitter: require('./twitter'),
x: require('./x'),
youtube: require('./youtube')
}

Expand Down
File renamed without changes.

0 comments on commit 63a2013

Please sign in to comment.