Insta Downloader is a React application built with Vite. It allows users to download Instagram posts.
Before you start, make sure you have Node.js and npm installed on your machine.
-
Clone the repository:
git clone https://github.com/yourusername/insta-downloader.git
-
Navigate into the project directory:
cd insta-downloader
-
Install the dependencies:
npm install
During development, we use Vite's built-in proxy to avoid CORS issues. The proxy is configured in vite.config.js
.
To change the proxy target, open vite.config.js
and find the proxy
option:
export default defineConfig({
plugins: [react()],
server: {
proxy: {
'/api': {
target: 'https://safe-dusk-18400-bc6e0d3dfe3f.herokuapp.com',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}
});
Replace https://safe-dusk-18400-bc6e0d3dfe3f.herokuapp.com
with the URL of your own backend server.
This proxy configuration tells Vite to route any requests from /api
to https://safe-dusk-18400-bc6e0d3dfe3f.herokuapp.com/
. The rewrite
option removes the /api
prefix from the request path.
Remember to restart your development server after changing the proxy configuration.
Additionally, make sure to update your API fetch requests in your React code. For development, replace the hardcoded server URL with /api
:
fetch("/api/data", { ... });
This ensures that the proxy configuration is used during development, avoiding CORS issues.
To start the development server, run:
npm run dev
To build the application for production, run:
npm run build
To preview the production build, run:
npm run preview
- React
- Vite
- Heroku (for the backend)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the MIT license for more information.