This file contains hidden or 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
| <?php echo 'baba';?> |
This file contains hidden or 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
| var info = { | |
| "name" : "sonha", | |
| "age" : 12 | |
| } | |
| var events = require("events"); | |
| var eventEmitter = new events.EventEmitter(); | |
| var connectHandler = function connected(err,data) { | |
| if(err) { | |
| console.log(err); |
This file contains hidden or 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
| var http = require('http'); | |
| mysql = require('mysql'); | |
| var connection = mysql.createConnection({ | |
| user : "root", | |
| password : "", | |
| database : "nodejs" | |
| }); |
This file contains hidden or 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
| var http = require("http"); | |
| var server = http.createServer(function(req, res) { | |
| console.log("Incoming Request" + req.method, "-" , req.url); | |
| if(req.method == "GET" && req.url =="/") { | |
| res.writeHead(200, {"Content-Type" : "application/json"}); | |
| res.write("This is home page"); | |
| res.end(); | |
| } |
This file contains hidden or 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
| .info { | |
| background: red; | |
| } |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Lap trinh NodeJS Tai Ha Noi</title> | |
| <link rel="stylesheet" type="text/css" href="/public/css/index.css"> | |
| </head> | |
| <body> | |
| <div class="info">Trung tam lap trinh Codeto</div> | |
| <h1>Khoa hoc NodeJS Can Ban</h1> |
This file contains hidden or 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
| var http = require("http"); | |
| var fs = require("fs"); | |
| var path = require("path"); | |
| //request | |
| //response : tra ve ket qua cho nguoi dung, dinh nghia kieu du lieu se tra ve | |
| var server = http.createServer(function(req, res) { | |
| console.log("Incoming Request" , req.method, '- ', req.url); | |
| //Route, check truong hop url giong nhau |
This file contains hidden or 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
| var users = [ | |
| { | |
| "id" : 1, | |
| "name" : "Simon Ha", | |
| }, | |
| { | |
| "id" : 2, | |
| "name" : "Kevil Ba", | |
| } | |
| ]; |
This file contains hidden or 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
| var http = require("http"); | |
| var fs = require("fs"); | |
| var path = require("path"); | |
| var model = require("./model"); | |
| //request | |
| //response : tra ve ket qua cho nguoi dung, dinh nghia kieu du lieu se tra ve | |
| var server = http.createServer(function(req, res) { | |
| console.log("Incoming Request" , req.method, '- ', req.url); |
This file contains hidden or 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
| var express = require("express"); | |
| var app = express(); | |
| app.get('/', function(req, res){ | |
| res.send("This is first application"); | |
| }); | |
| app.listen(3000); |
OlderNewer