Index.js
const jsonServer = require("json-server"); // importing json-server library
const server = jsonServer.create();
const router = jsonServer.router("db.json");
const middlewares = jsonServer.defaults();
const port = process.env.PORT || 8080; // chose port from here like 8080, 3001
server.use(middlewares);
server.use(router);- Make new repo on github
- Git clone repolink
- Cd repo
- npm init -y (create pakage.json file)
- npm i json-server cors json-serve (add some json dependency)
- Add Inde.js
const jsonServer = require("json-server"); // importing json-server library- npm install -g firebase-tools (install firebase cli global)
- firebase login (login with your account)
- firebase init (initalize the project)
- Then open firbase.json file and this
"rewrites": [ {
"source": "**",
"destination": "/index.html"
} ]- sudo apt-get install mongodb;
- you want to continue?[y/n] y
- sudo apt-get update;
- sudo service mongodb start;
- mongo(after this command that opens the command prompt);
Go to settings > extensions > emmet > include languages and add javascript as the item and javascriptreact as the value.
npx json-server --watch src/db.json on --port 40001. npx create-react-app newapp
2. open pakeage json
3. npm install gh-pages --save-dev
4. Add homepage https://anupamit.github.io/
5. Add in script
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
6. git init
7. git remote add origin https://github.com/Anupamit/anupamit.github.io.git1. git init
2. git add .
3. git commit -m 'adding new something'
4. git remote add origin https://github.com/Anupamit/anupamit.github.io.git
5. git push -u -f origin mastergit commit --allow-empty --date="dec 23 2019 " -m 'comment'1- git init (initial, one time command in a folder, to make a folder git understandable and uploadable to cloud)
2- git status (to checkstatus of the folder)
3- git add . (to make all files upload ready) (git add ..................n)
4- git commit -m "<message>" (to put message for upload / push)
NewerOlder