Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hezhii/cross-domain-example

A example of the CORS on Node.js
https://github.com/hezhii/cross-domain-example

cors nodejs

Last synced: 14 days ago
JSON representation

A example of the CORS on Node.js

Awesome Lists containing this project

README

        

# Nodes.js 跨域

利用 CORS 实现的一个跨域的例子。

## 如何运行

将仓库克隆到本地,并安装需要的依赖,然后启动服务即可。

```bash
$ git clone https://github.com/hezhii/cross-domain-example.git
$ cd cross-domain-example
$ npm install
$ npm start
```

启动服务后访问:`localhost:8081`。在页面上分别点击三个按钮可以测试 GET、POST 跨域以及跨域不成功的情况。