Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ node_modules
apps/stock-price-checker-proxy/cache/
apps/twitch-proxy/.data/
apps/twitch-proxy/.logs/
apps/yelp-proxy/.data/
apps/yelp-proxy/.logs/
Caddyfile
.eslintcache
.eslintcache
6 changes: 6 additions & 0 deletions apps/yelp-proxy/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
.git
.gitignore
.dockerignore
node_modules
Dockerfile
13 changes: 13 additions & 0 deletions apps/yelp-proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18-bullseye-slim

WORKDIR /app

# Copy over all the files in the project directory to /app early
# for rollup bundling
COPY . .

ENV PORT=3000

RUN npm cigit

CMD ["npm", "start"]
1 change: 1 addition & 0 deletions apps/yelp-proxy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Yelp API
32 changes: 32 additions & 0 deletions apps/yelp-proxy/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require('dotenv').config({ silent: true });

module.exports = {
serveStaticData: false,
port: parseInt(process.env.PORT) || 3000,
host: 'https://yelp-proxy.freecodecamp.rocks/',
logLevels: {
_default: 'info',
file: 'warn',
filePath: `${__dirname}/.logs`
},
validRoutes: {
businesses: { q: ['name', 'city'] },
reviews: { q: ['stars'] }
},
outboundReqsLimiter: {
active: true,
checkIntervalMs: 15000,
maxOBReqsPerInterval: 55
},
blacklist: {
active: true,
urls: [
'www.donotargue.com',
'www.csulbesports.org',
'https://www.photoshoptroll.com'
],
ips: ['78.145.103.20', '107.178.192.90', '204.236.208.181'],
cooldown: 3000
},
baseApiUrl: 'https://fusion.yelp.com/'
};
5 changes: 5 additions & 0 deletions apps/yelp-proxy/kill-node-process-cron.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const cron = require('node-cron');

cron.schedule('0 0 1 * *', () => {
process.kill(1);
});
Loading
Loading