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"); | |
| http.createServer(function(request, response) { | |
| response.writeHead(200, {"Content-Type": "text/plain"}); | |
| response.write("Welcome to node.js World"); | |
| response.end(); | |
| }).listen(9000); |
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"); | |
| function onRequest(request, response) { | |
| response.writeHead(200, {"Content-Type": "text/plain"}); | |
| response.write("Welcome to node.js World"); | |
| response.end(); | |
| } | |
| http.createServer(onRequest).listen(9000); |
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"); | |
| function onRequest(request, response) { | |
| console.log("Request received."); | |
| response.writeHead(200, {"Content-Type": "text/plain"}); | |
| response.write("Welcome to node.js World"); | |
| response.end(); | |
| } | |
| http.createServer(onRequest).listen(9000); |
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"); | |
| function onRequest(req, res) { | |
| if (req.url == "/") { | |
| res.writeHead(200, { "Content-Type": "text/html" }); | |
| res.end("Welcome to the homepage!"); | |
| } | |
| // About page | |
| else if (req.url == "/contact") { |
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('welcome to home page!'); | |
| }); | |
| app.get('/about', function (req, res) { | |
| res.send('welcome to about page!'); | |
| }); |
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
| 'use strict'; | |
| var mongoose = require('mongoose'), | |
| Schema = mongoose.Schema; | |
| /** | |
| * @module company | |
| * @description contain the details of company information, conditions and actions. | |
| */ |
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
| 'use strict'; | |
| var Company = require('../model/company').Company; | |
| /** create function to create Company. */ | |
| exports.create = function (req, res) { | |
| Company.create(req.body, function(err, result) { | |
| if (!err) { | |
| return res.json(result); | |
| } else { |
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
| 'use strict'; | |
| //Start by defining the main module and adding the module dependencies | |
| angular.module(ApplicationConfiguration.applicationModuleName, ApplicationConfiguration.applicationModuleVendorDependencies); | |
| // Setting HTML5 Location Mode | |
| angular.module(ApplicationConfiguration.applicationModuleName).config(['$locationProvider', | |
| function($locationProvider) { | |
| $locationProvider.html5Mode({ | |
| enabled: true, |
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
| 'use strict'; | |
| // Init the application configuration module for AngularJS application | |
| var ApplicationConfiguration = (function() { | |
| // Init module configuration options | |
| var applicationModuleName = 'nodeapp'; | |
| var applicationModuleVendorDependencies = ['ngResource', 'ui.router', 'angular-growl']; | |
| // Add a new vertical module | |
| var registerModule = function(moduleName, dependencies) { |
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
| <!-- index.html --> | |
| <!doctype html> | |
| <!-- ASSIGN OUR ANGULAR MODULE --> | |
| <html > | |
| <head> | |
| <!-- META --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"><!-- Optimize mobile viewport --> | |
| <base href="/"> |
OlderNewer