Skip to content

Instantly share code, notes, and snippets.

View Anupamit's full-sized avatar
🏐
Lets Do This....

Anupam Rai Anupamit

🏐
Lets Do This....
  • NeoLotex Business Solutions Private Limited
  • Bangalore
  • LinkedIn in/anupamit
View GitHub Profile
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);
  1. Make new repo on github
  2. Git clone repolink
  3. Cd repo
  4. npm init -y (create pakage.json file)
  5. npm i json-server cors json-serve (add some json dependency)
  6. Add Inde.js
const jsonServer = require("json-server"); // importing json-server library
  1. npm install -g firebase-tools (install firebase cli global)
  2. firebase login (login with your account)
  3. firebase init (initalize the project)
  4. Then open firbase.json file and this
"rewrites": [ {
      "source": "**",
      "destination": "/index.html"
    } ]
  1. sudo apt-get install mongodb;
  2. you want to continue?[y/n] y
  3. sudo apt-get update;
  4. sudo service mongodb start;
  5. 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 4000
@Anupamit
Anupamit / DeployReactAppOnGithubPage.md
Last active March 25, 2024 04:14
Deploy React app on Github page
1. 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.git
1. 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 master
git commit --allow-empty --date="dec 23 2019 " -m 'comment'
@Anupamit
Anupamit / GitSetupCommands.md
Last active March 25, 2024 04:21
In this gist we are seeing the starter of github commit

Useful git commands

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)