https://github.com/thinkful-ed/starter-cors-back-end
Connecting It all: CORS starter back-end project
https://github.com/thinkful-ed/starter-cors-back-end
Last synced: 5 months ago
JSON representation
Connecting It all: CORS starter back-end project
- Host: GitHub
- URL: https://github.com/thinkful-ed/starter-cors-back-end
- Owner: Thinkful-Ed
- Created: 2020-12-04T20:44:19.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-31T16:53:09.000Z (over 3 years ago)
- Last Synced: 2023-05-09T21:10:35.951Z (about 3 years ago)
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 9
- Forks: 414
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CORS Back-End Starter Project
This project serves as a foundation for handling Cross-Origin Resource Sharing (CORS) issues when building back-end applications. It demonstrates how to configure a Node.js server to allow or restrict access to external APIs from different origins.
## Features
- Configurable CORS settings
- Basic server setup for API requests
## Installation
1. Clone or fork this repository:
```bash
git clone https://github.com/Thinkful-Ed/starter-cors-back-end.git
```
2. Navigate to the project directory:
```bash
cd starter-cors-back-end
```
3. Install dependencies:
```bash
npm install
```
4. Start the server:
```bash
npm start
```
To run in development mode (with auto-reload):
```bash
npm run start:dev
```
5. Set the `PORT` environment variable if needed. The default is `5555`.
## Usage
The application starts a server on the specified port, allowing requests from different origins based on CORS configuration. This starter code helps with setting up an API backend that interacts with various front-end clients.
## Technologies
- **Node.js**: JavaScript runtime for building server-side applications.
- **Express**: Web framework for managing server routes and middleware.
- **CORS**: Configurable middleware for handling cross-origin requests.