https://github.com/monmohan/cors-tutorial-practical
Demonstrate different CORS scenarios (pre-flight etc.)
https://github.com/monmohan/cors-tutorial-practical
Last synced: 6 months ago
JSON representation
Demonstrate different CORS scenarios (pre-flight etc.)
- Host: GitHub
- URL: https://github.com/monmohan/cors-tutorial-practical
- Owner: monmohan
- License: mit
- Created: 2016-05-03T04:13:06.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-08-24T04:14:47.000Z (almost 2 years ago)
- Last Synced: 2024-08-24T10:36:47.136Z (almost 2 years ago)
- Language: Go
- Size: 8.54 MB
- Stars: 18
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Step by Step Tutorial
* The code in this repository is used to demonstrate CORS concepts like - Simple GET with Allow-Origin, requests needing pre-flight and handing credentials
* Step by Step tutorial using this code is available as three part blog series
* [Part I](https://medium.com/@software_factotum/cross-origin-resource-sharing-a-hands-on-tutorial-fb19748cb3b7)
* [Part II](https://medium.com/@software_factotum/cross-origin-resource-sharing-a-hands-on-tutorial-part-ii-complex-requests-ed5be46fadcf)
* [Part III](https://medium.com/@software_factotum/cross-origin-resource-sharing-a-hands-on-tutorial-part-iii-cookies-a60ecbee0983)
# Running the demo
* Download and install [golang](https://golang.org/dl/)
* Clone the repo
`git clone git@github.com:monmohan/cors-tutorial-practical.git`
* Running the Servers
+ Map couple of loopback interfaces to page and apiserver. For example here is my etc/hosts file
```
127.0.0.2 pageserver.cors.com
127.0.0.3 apiserver.cors.com
```
+ The servers can be run directly from the source
+ Change to the relevent directory
+ Type `go run `
- Follow along the Blogs or play around with the code .
Have Fun !