Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
FeiyouG committed Apr 24, 2022
1 parent 8b83e4f commit bc9ff65
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Then, clone this project:
$ git clone https://github.com/gfeiyou/syn_bio_vis.git
```

### Set up environment variables
following environment variables needs to be set

### Set up Server
Inside the folder `syn_bio_vis/server/`, run `npm install` to install all
the dependencies for the server.
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ const app = express();

app.use(bodyParser.json({ limit: "30mb", extended: true }));
app.use(bodyParser.urlencoded({ limit: "30mb", extended: true }));
app.use(cors());

const corsOptions ={
origin: process.env.CLIENT_ORIGIN || 'http://localhost:3000',
credentials:true, //access-control-allow-credentials:true
optionSuccessStatus:200
}

app.use(cors(corsOptions));

// All routes inside routes/simRoutes must append "/sim" in the front
// app.use('/sim', simRoutes);
Expand All @@ -18,5 +25,6 @@ app.use('/tutor', tutorRoutes);

// Start the server
// TODO: Change PORT for production code
const PORT = process.env.PORT || 3001;
const PORT = process.env.SERVER_PORT || 3000;
// const HOSTNAME = "0.0.0.0";
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));

0 comments on commit bc9ff65

Please sign in to comment.