This web app integrates with Reddit’s API to show the top posts in a given subreddit.
The flow of the code is as follows:
- The subreddit search form accepts searchTerm, sortBy and searchLimit as queries.
- When the form identifies a
'submit'
event, it parses the search queries. - Then it send a
GET
request according to that queries, to fetch the recent data from Reddit API. - Iterate through the relevant data (subreddit's posts) and parse all as HTML code.
- Add the results to the Main view
index.ejs
file.
Application deployed on Heroku: https://reddit-tal.herokuapp.com/
To run the tests:
npm test
- Express as Node.js web application framework
- Ejs to include dynamic data to the html
- Bootstrap as the CSS framework
- Mocha as testing framework
To launch the application locally:
- Clone repo:
git clone https://github.com/talhazi/RedditFeed.git
- Enter the directory:
cd RedditFeed
- Install dependencies:
npm install
- Run the app:
npm start
Now the server should run at: http://localhost:3000# dev mode npm run dev
Tal Hazi <> [email protected]