background preloader

Pixelhandler's Blog

Pixelhandler's Blog
Related:  angularjsJavascript

2. Установка Node.js и создание базового приложения Добро пожаловать во вторую часть руководства по созданию веб-приложения с помощью Node.js. В рамках серии уроков будет рассказано про основные особенности и трудности, которые возникают при работе с Node.js. Первая часть руководства была вводной и объясняла логику выбора библиотек для Node.js приложений. Данная часть сериии освящает процесс установки необходимых пакетов и библиотек. 2.1. Наш проект имеет следующие зависимости: Node.jsMongoDBnpm Далее я пройдусь по каждому пункту и расскажу о том, как выполнить установку. 2.2. Если Node.js еще не установлен, то необходимо скачать исходный код и распокавать его. . Возможно, перед запуском make install придется изменить права доступа к директории, либо использовать sudo или su. Эти шаги актуальны только для *nix-систем. 2.3. В качестве базы данных я хочу использовать MongoDB. Для MongoDB необходима директория для данных, создать которую достаточно просто с помощью: Это - путь по-умполчанию, но его легко изменить. 2.4. npm . Примечание 2.5. 2.6.

Node.js REST framework Node Philly | Spreading the Node.js love in the City of Brotherly Love Serving Static Files from Node.js Posted: 5/6/2011 12:14 PM In the last post I showed you how to get started with Node.js on Windows. Easy, wasn’t it? Remarkably so since there was no install requirement. This time we are going to tweak the system a bit then learn how to return static files like plain ol’ Html, Css and Javascript files. Note, for posterity's sake, that all of this is based on node.js as of version 0.4.7. Making Things Easier Last time we got started by unzipping the file that contained all the node files. Computer > Right-click and hit properties > Advanced System Settings (on the left) > Environment Variables > System Variables > Path > add “C:\Program Files\Node” So now the files that we use can be in a directory all their own and you still only have to type “node.exe server.js” to get started. And another tip, keep Fiddler open while you mess around with node. Serving Up A File First, let’s create a very basic html page. <html><head><title>Rockin' Page</title></head><body><p>This is a page. And voila!

The Future of Web Apps – Single Page Applications | The Worm Hole The Future of Web Apps – Single Page Applications Mark Boas The world wide web is constantly evolving and so is the way we write the applications that run upon it. The web was never really designed as a platform for today’s applications, nevertheless we continue to bend it to our will. Due to differing paradigms we are forced to design our web apps in a completely different way to native apps. The price is high. In this article I propose that we can have our cake and eat it. But first let’s take a look at the advantages of a single-page approach. 1. What we are essentially talking about here is having an application where ‘virtual pages’ are loaded into one single web-page, which means switching between pages need not involve a trip to the server and so the switch occurs almost instantly. 2. Using the ‘traditional’ approach we load a lot of duplicated content for each page we visit. 3. Making it Work I’m assuming that for a web application we are using some kind of server-side language. 2.

Brian Ford AngularJS is like the missing Batarang on your utility belt of web development awesomeness. It gives you two-way data binding that's both easy to use and fast, a powerful directive system that lets you use create reusable custom components, plus a lot more. Express is an excellent webserver for Node.js that provides routing, middleware, and sessions. Incidentally, the two work quite well together! In this tutorial, I'm going to walk through writing a simple blog app with Angular and Express. For this, I'm assuming basic knowledge of Angular and Node. If you'd rather skip to the end and see the finished product, you can grab the finished product from Github, or take a look at a live demo here. Anatomy of the App This application is really divided into two parts: client, and server. Getting the Angular Express Seed To kick start the process of writing an AngularJS app, I've created the Angular Express Seed, based on the Express web server (which runs on Node.js) and the Angular Seed. <!

API v3 Iris Couch NowJS and Node.js Tutorial – Creating a multi room chat client | Aditya Ravi Shankar Node.js is a server side environment for Javascript. NowJS is a framework built on top of Node.js that connects the client side and server side Javascript effortlessly. The core of NowJS functionality lies in the now object.The now object is special because it exists on the server and the client.This means variables you set in the now object are automatically synced between client and server. You can have a working HTTP server up and running in Node.JS with just a few lines of code. This little snippet of code will create an HTTP server, listen on port 8080, and send back “Hello World” for every request. Using NowJS, communication between the client and server side is just as simple. Client Side: <script type="text/javascript"> now.ready(function(){ now.clientSideVariable = 'someValue'; now.serverSideFunction(); }); </script> <script type="text/javascript">now.ready(function(){ now.clientSideVariable = 'someValue'; now.serverSideFunction();});</script> Server Side: 1. 2. 3. 4. 5.

Asynchronous Programming in JavaScript with “Promises” - IEBlog Asynchronous patterns are becoming more common and more important to moving web programming forward. They can be challenging to work with in JavaScript. To make asynchronous (or async) patterns easier, JavaScript libraries (like jQuery and Dojo) have added an abstraction called promises (or sometimes deferreds). With these libraries, developers can use promises in any browser with good ECMAScript 5 support. In this post, we’ll explore how to use promises in your web applications using XMLHttpRequest2 (XHR2) as a specific example. Benefits and Challenges with Asynchronous Programming As an example, consider a web page that starts an asynchronous operation like XMLHttpRequest2 (XHR2) or Web Workers. When you make an asynchronous call, you need to handle both successful completion of the work as well as any potential errors that may arise during execution. function searchTwitter(term, onload, onerror) { var xhr, results, url; url = ' onload(results); if (!

Sociogram: A Sample Application demonstrating AngularJS/Ionic and Facebook Integration About a year ago, I blogged Sociogram, a starter project demonstrating how to integrate with Facebook in your mobile and web applications. A year later, it’s time for a makeover: Here is a brand new version of Sociogram, built with AngularJS, Ionic, and the OpenFB micro-library I shared earlier this week. Sociogram is a sample application that demonstrates how to: Login with FacebookRequest specific permissionsRevoke permissionsGet data (list of friends, mutual friends, feed items, etc.)Post to your feed The application also demonstrates some cool Ionic features such as: Sliding MenuPull-to-Refresh (in Feed)“Loading…” UI (while waiting for the feed to load) Try it Here Click here to run a hosted version of Sociogram and access your Facebook data. Source Code The source code is available in this repository on GitHub. Getting Started To run the sample application on your own system: Create an Ionic projectAdd the inappbrowser plugin to your project

Related:  Node