This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const path = require('path'); | |
app.use(express.static(path.join(__dirname, '/'))); | |
app.get('/', function (req, res) { | |
console.log("__dirname : ",__dirname); | |
res.sendFile(path.join(__dirname, 'index.html')) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Notification demo by Shubham Verma</title> | |
<script> | |
function showDesktopNotification() { | |
const myNotification = new Notification("heading of the notification", { | |
icon: 'demo2.jpg', | |
body: "This is the body of the notification, Its a demo for learnig browser notification", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import './App.css'; | |
import TypeAheadDropDown from './TypeAheadDropDown'; | |
import cities from './indianCities.js' | |
function App() { | |
return ( | |
<div className="App"> | |
<TypeAheadDropDown iteams={cities} /> | |
</div> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.TypeAheadDropDown{ | |
width: 100%; | |
border: 1px solid gray; | |
box-shadow: 0 0 1px rgba(0,0,0,0.1), 0 2px 4px 1px rgba(0,0,0, .18); | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 14px; | |
color: rgba(0, 0, 0, 0.73); | |
} | |
.TypeAheadDropDown input{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TypeAheadDropDown.js | |
import './TypeAheadDropDown.css' | |
import React from 'react'; | |
export default class TypeAheadDropDown extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
suggestions: [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default [ | |
'Agra', | |
'Allahabad', | |
'Aligarh', | |
'Ambedkar Nagar', | |
'Auraiya', | |
'Azamgarh', | |
'Barabanki', | |
'Bijnor', | |
'Ballia', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let chai = require(‘chai’); | |
let chaiHttp = require(‘chai-http’); | |
var should = chai.should(); | |
chai.use(chaiHttp); | |
let server = require(‘../app’);//Our parent block | |
describe(‘Podcast’, () => { | |
describe(‘/GET media’, () => { | |
it(‘it should GET all the podcast’, (done) => { | |
chai.request(server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const port = 3300; | |
app.get('/message', function (req, res) { | |
res.send('This is the message'); | |
}); | |
app.get('/media', function (req, res) { | |
var response = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "demotest", | |
"version": "1.0.0", | |
"description": "this is to understand the demo.", | |
"main": "server.js", | |
"directories": { | |
"test": "test" | |
}, | |
"scripts": { | |
"test": "mocha — timeout 10000", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cli.init = function () { | |
/* Send the start message to the console in dark blue. */ | |
console.log(‘\x1b[33m % s\x1b[0m’, ‘CLI is running’); | |
/* Start the interface */ | |
var _interface = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
prompt: ‘>’ | |
}) |
NewerOlder