diff options
| author | realS1ant <45408404+realS1ant@users.noreply.github.com> | 2021-04-11 02:52:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-11 02:52:00 -0500 |
| commit | 14198b83d6fdab123873744f7056eb9ecfd783e5 (patch) | |
| tree | e0cf5ccc3ae18e4f4e7cf78fa0ecfa7496f2a835 /src/app.js | |
| parent | db9c2b888dae53a16f371fe9425e7621fb2ed004 (diff) | |
| parent | 1a75774bd8b43d76a1cc9fb07817f39df849001b (diff) | |
| download | StreamFinder-14198b83d6fdab123873744f7056eb9ecfd783e5.tar.xz StreamFinder-14198b83d6fdab123873744f7056eb9ecfd783e5.zip | |
Merge pull request #6 from FivePixels/backend-api
Cors headers
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,10 +1,12 @@ const express = require('express') const app = express(); const morgan = require('morgan'); +const cors = require('cors'); const { performCheck } = require('./check'); require('dotenv').config(); app.use(express.json()); +app.use(cors()); if (process.env.ENV == 'dev') app.use(morgan('dev')); app.get('/api/performCheck', async (req, res) => { @@ -18,8 +20,7 @@ app.get('/api/performCheck', async (req, res) => { return; } const { id, query, type } = req.query; - - console.log(`Performing check with ID: ${id} Query: ${query} and Type: ${query}`); + console.log(`Performing check with ID: ${id} Query: ${query} and Type: ${type}`); res.status(200).json(await performCheck(id, query, type)); return; res.status(200).json({ |
