File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "name" : " reverse-proxy" ,
3+ "version" : " 1.0.0" ,
4+ "description" : " " ,
5+ "main" : " server.js" ,
6+ "scripts" : {
7+ "test" : " echo \" Error: no test specified\" && exit 1" ,
8+ "start" : " node server.js"
9+ },
10+ "author" : " " ,
11+ "license" : " ISC" ,
12+ "dependencies" : {
13+ "cors" : " ^2.8.5" ,
14+ "express" : " ^4.17.1" ,
15+ "express-http-proxy" : " ^1.5.1" ,
16+ "http-proxy" : " ^1.17.0"
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ var express = require ( 'express' )
2+ var cors = require ( 'cors' )
3+ const proxy = require ( 'express-http-proxy' ) ;
4+
5+ var app = express ( )
6+
7+ var corsOptions = {
8+ origin : true ,
9+ optionsSuccessStatus : 200 ,
10+ credentials : true
11+ }
12+
13+ app . use ( cors ( corsOptions ) ) ;
14+ app . use ( proxy ( 'argos2.test.hypertopic.org' ) ) ;
15+
16+
17+
18+
19+ app . listen ( 80 , function ( ) {
20+ console . log ( 'CORS-enabled web server listening on port 80' )
21+ } )
You can’t perform that action at this time.
0 commit comments