Feedback app demo
Run it locally:
npm install
npm run dev
Deploy it to Heroku:
The blog haven't publish yet, I will update the blog URL soon...
About: An IoT and blockChain developer; interested in Cloud Computing; love coding...
Assuming you have already done the following:
create a file named Procfile in the root directory, and paste the following code into the file:
web: node server.js
create a file named server.js in the root directory, and paste the following into the file:
const jsonServer = require("json-server");
const server = jsonServer.create();
const router = jsonServer.router("./db.json");
const middlewares = jsonServer.defaults({
static: "./build",
});
const PORT = process.env.PORT || 8000;
server.use(middlewares);
server.use(
jsonServer.rewriter({
"/api/*": "/$1",
})
);
server.use(router);
server.listen(PORT, () => {
console.log("Server is running");
});
(1) Commit the changes above to your Git repo. Then,
(2) Log in to your Heroku account, and create a new app:
(3) In the Deploy
catalogue, select GitHub
as your Deployment method
, find your repo and Connect
it to Heroku:
(4) Click Deploy Branch
to deploy your app.
Suppose the whole procedure finishes without any problem, congrats! And now, you can click Open app
to see your deployed app.
That's the end of this article. I want to share my deployed repo here, and please feel free to check interesting things, play it, fork and give stars, and leave a message below if you have questions.
See you!
Deployment:
https://www.youtube.com/watch?v=DAuHI7bHx1Q
Learn React.js:
https://www.skillshare.com/classes/React-Front-To-Back-2022/1541849001/projects?via=member-home-EnrolledClassesLessonsSection
Cover image:
https://blog.devgenius.io/how-to-deploy-your-first-full-stack-web-application-react-rails-heroku-17a799e78bb4
Very helpful