This project fetches random images from various subreddits using the Reddit API and displays them in a web application built with Express and EJS.
- Fetches random images from specified subreddits.
- Sorting options: hot, new, top.
- Time filtering options: hour, day, week, month, year, all.
- Simple and easy-to-use web interface.
- Node.js
- Express.js
- EJS (Embedded JavaScript templates)
- Node-fetch (for making HTTP requests)
-
Clone the repository:
git clone https://github.com/dusova/reddit-random-image-api.git cd reddit-random-image-api
-
Install the necessary dependencies:
npm install
-
Start the application:
node app.js
-
Open your web browser and go to
http://localhost:3000
.
- Visit the homepage to see a random image from the selected subreddits.
- To view specific subreddits, go to
http://localhost:3000/:subreddit_name
.
- To view images from the "cats" subreddit, go to
http://localhost:3000/cats
.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to submit issues or pull requests to improve the functionality or features of the application!
Feel free to customize the content further!