Answer the question
In order to leave comments, you need to log in
Server not working after deploying react app?
The application is running locally, getting data from the server and rendering on the client, but after deploying to heroku, the server data is not shown to the
server:
const express = require('express');
/* const bodyParser = require('body-parser'); */
const server = express();
const port = 8090;
const cors = require('cors');
server.use(cors());
/* server.use(bodyParser.json()); */
server.get('/api/v1/startup', (req, res) => {
res.send(
JSON.stringify(
[{"startup_id":1,"startup_name":"Mangoswap",
}] "scripts": {
"start": "react-scripts start",
"server": "nodemon server/server.js",
"dev": "concurrently \"yarn run start\" \"yarn run server\"",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question