Create a simple web server with express using Node js

express node js javascript 4 years, 11 months ago
const express = require('express') const app = express() app.get("/", (request, res)=>{ res.send("<h1>Hello express!</h1>") }) app.get("/about", (req, response)=>{ response.send("<h2>About Page</h2>") }) app.listen(8000, ()=>{ console.log("Server is up on port 8000") })
1617
Posted By
Dynamic templating using express and handleba
//app.js
const path = require("path");
const express = require("express")
express dynamic templating javascript npm handlebars
harika
How to change the location of views in expres
//Express handlebars expect the views fo
//to configure or change the name from v
//it will give you error such that the f
express dynamic templating javascript npm handlebars
harika
Work with inline styles in React js
//plugin to any test js file and proceed
//This is the best standard to work with
const style = {background:'cyan', color:
javascript react js css
harika
Work with 3rd party css libraries in react fr
import React from 'react'
//No need to give the complete path, rea
//If not exists searches globally
javascript react js
harika
work with react without node installation in
//Basic way
<!DOCTYPE html>
<html>
javascript react js html
harika
Difference between state and stateless compon
//State Component
<!DOCTYPE html>
<html>
javascript react js
harika
Create a React app without webpack and Create
//Basic way
<!DOCTYPE html>
<html>
javascript react js webpack
harika
JQuery toggle functionality in react
import React from 'react'
export default class ToggleComponent ext
  constructor(props){
javascript react js
harika
display state inside any html tag
import React from 'react'
export default class StateProps extends 

javascript react js
harika
Import any class irrespective of default expo
import React, { Component } from 'react'
javascript react js
harika
Run Java script code Synchronously inside a f
async function showAvatar() {

  // read our JSON
javascript
harika
Run shell files in javascript
//JS Code
function runShellScript(){
    const process = require('child_proce
javascript shell node js
harika
XHR Request & Ajax Request
//Fill
javascript
harika
Pass Data/Properties from child to parent in
//Parent.js
import React from "react";
import Child from './Child'
javascript react js
harika
delete a folder in javascript
// Delete the files recursively.
//fs is a built in node module.
const fs = require('fs');
javascript node js
harika
Write string or json objects directly to a fi
const fs = require('fs');
//fs is a built in module in node js
const filePath = '/Desktop/Test.json';
javascript node js
harika
Check whether the file node is a directory or
//fs is a built in node module
const fs = require('fs');
const filePath = "/home/Desktop"
javascript node js
harika
How to read all video AdGroups using Adwords
function getAllVideoAdGroups() {
  var adGroupIterator = AdWordsApp.video
  Logger.log('Total adGroups found : ' +
javascript adwords-script
kishore_kumar
Set Component state from other component / ou
/*App.js*/
import React, { Component } from 'react'

javascript react js
harika
Compress files synchronously in javascript
const tar = require('tar');
  tar.c(
    {
node js javascript react js
harika