Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Scotch.io - Create a CRUD App with Node and MongoDB 1 Getting Started

// 0)create a repo of your project folder in github first
// 1)in your folder open git bash
npm init
// 2)leave description,test command,keywords,author as empty
// 3)But name entry point as
server.js
// 4)go to github and copy url of repo and use that for github repository
URL.git// URL is copied from github
// 5) install Express
npm install --save express
// 5)open your project folder in vs code
// 6)in opened folder create new file server.js with below exact code:

// grab our dependencies
const express = require('express'),
app = express(),
port = process.env.PORT || 8080;

// configure our application

// set the routes
app.get('/', (req, res) => {
res.send('Hello, I am the app!');
});

// start our server
app.listen(port, () => {
console.log(`App listening on http://localhost: ${port}`);
});

// 7)install server(just once run this command not again)
npm install -g nodemon
// 8)Run server 
nodemon server.js

****************************
"Hello, I am the app!" should be there on localhost 8080 by now!
Comment

Scotch.io - Create a CRUD App with Node and MongoDB 2 App Foundation

NOTE: crudapp is project folder name
1) create folder app inside crudapp
2) create folders controllers,models inside app
3) create file routes.js inside app
4) create file main.controller.js inside controllers
5) create folder public inside crudapp
6) create folder css inside public
7) create file style.css inside css
8) create folder views inside crudapp
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to get second low value in js 
Javascript :: flutter enum to json 
Javascript :: Perform native operation by javascript in Android 
Javascript :: react clikc with ref 
Javascript :: discord.js message edit 
Javascript :: loopback 4 pagination 
Javascript :: concat not working javascript 
Javascript :: cookies in electron 
Javascript :: how to call javascript function in p tag 
Javascript :: bootstrap dropdown with state 
Javascript :: To enable server-to-server and REST tools like Postman to access our API - 
Javascript :: create multidimensional array with foreach javascript 
Javascript :: repidme 
Javascript :: SH1 in react native 
Javascript :: cypress json no videos 
Javascript :: How to Define a Function using Function Declaration in javascript 
Javascript :: es6 spread operator 
Javascript :: scroll to bottom of page javascript 
Javascript :: reloading init state 
Javascript :: Javascript Recursion shuffle card 
Javascript :: validar fecha jquery 
Javascript :: How to Solve the Staircase Problem with JavaScript using Memoization 
Javascript :: Use a stack to convert the infix expression x*y-2 into post-fix 
Javascript :: vscode react must be in scope when using JSX - eslint 
Javascript :: Parsing the URL string using the WHATWG API 
Javascript :: react js public folder image path search 
Javascript :: verifier si chaien ade caractere apparait dans autre js 
Javascript :: events in node js 
Javascript :: how ton give form widget to zoho creaor 
Javascript :: Check if the same text is repeated javascript todo-app 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =