https://github.com/arnobt78/cors-proxy-server--employee-managment
This project is a simple CORS proxy server using the `cors-anywhere` package. It allows you to bypass the same-origin policy in web browsers by proxying your requests through this server. Frontend UI Source Code: https://github.com/arnobt78/Employee-Management-App-Angular18
https://github.com/arnobt78/cors-proxy-server--employee-managment
angular18 backend-server-side cors-anywhere cors-proxy cors-request crud-api crud-application crud-operation render-deployment server-side-rendering
Last synced: about 2 months ago
JSON representation
This project is a simple CORS proxy server using the `cors-anywhere` package. It allows you to bypass the same-origin policy in web browsers by proxying your requests through this server. Frontend UI Source Code: https://github.com/arnobt78/Employee-Management-App-Angular18
- Host: GitHub
- URL: https://github.com/arnobt78/cors-proxy-server--employee-managment
- Owner: arnobt78
- Created: 2025-01-12T11:48:41.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-15T11:41:04.000Z (3 months ago)
- Last Synced: 2025-03-31T04:49:13.357Z (about 2 months ago)
- Topics: angular18, backend-server-side, cors-anywhere, cors-proxy, cors-request, crud-api, crud-application, crud-operation, render-deployment, server-side-rendering
- Language: JavaScript
- Homepage: https://cors-proxy-avym.onrender.com
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## CORS-Proxy-Server-Employee-API (Backend/ Server-Side for Employee-Managment-App-Angular18 Project)
This project is a simple CORS proxy server using the `cors-anywhere` package. It allows you to bypass the same-origin policy in web browsers by proxying your requests through this server.
**Frontend UI Source Code:** https://github.com/arnobt78/Employee-Management-App-Angular18
## Project Structure
- `.gitignore`: Specifies files and directories to be ignored by Git.
- `package.json`: Contains metadata about the project and its dependencies.
- `package-lock.json`: Contains the exact versions of dependencies installed.
- `server.js`: The main server file that sets up and runs the CORS proxy.## Prerequisites
- Node.js (version 22.12.0 or later)
- npm (Node Package Manager)## Installation
1. Clone the repository:
```sh
git clone https://github.com/arnobt78/cors-proxy.git
cd cors-proxy
```2. Install the dependencies:
```sh
npm install
```## Running the Server
To start the CORS proxy server, run the following command:
```sh
npm start
```This will start the server on 0.0.0.0 at port 8080. You should see the following message in the console:
`CORS Anywhere server running on 0.0.0.0:8080`##Usage
To use the CORS proxy, make a request to the server with the target URL as a query parameter. For example:
`http://localhost:8080/http://example.com`
This will proxy the request to http://example.com and return the response.##Configuration
The server is configured to allow all origins and requires the origin and x-requested-with headers. It also removes the cookie and cookie2 headers from the request.
You can modify these settings in the `server.js` file:
```
corsAnywhere.createServer({
originWhitelist: [], // Allow all origins
requireHeader: ['origin', 'x-requested-with'],
removeHeaders: ['cookie', 'cookie2']
}).listen(port, host, () => {
console.log(`CORS Anywhere server running on ${host}:${port}`);
});
```## Deployment
To deploy this project on Render, follow these steps:
1. Create a new web service on Render.
2. Connect your GitHub repository.
3. Set the build command to `npm install`.
4. Set the start command to `npm start`.Render will automatically install the dependencies and start the server.