Full Trust European Hosting

BLOG about Full Trust Hosting and Its Technology - Dedicated to European Windows Hosting Customer

Node.js Hosting Russia - Use Simple Example Code to GET and POST in Node.js

clock January 27, 2015 06:05 by author Peter

With this post, I will write about using simple Example Code GET and POST in Node.js. In this post, I use this library (Simplified HTTP request client.) And here is the code:

GET
var request = require('request');
// Set the headers
var headers = {
    'User-Agent':       'Super Agent/0.0.1',
    'Content-Type':     'application/x-www-form-urlencoded'
}
// Configure the request
var options = {
    url: 'http://hostforlife.eu',
    method: 'GET',
    headers: headers,
    qs: {'key1': 'xxx', 'key2': 'yyy'}
}

// Start the request
request(options, function (error, response, body) {
    if (!error && response.statusCode == 200) {
        // Print out the response body
        console.log(body)
    }
})

Above code will do GET https://localhost:8080/?key1=xxx&key2=yyy

POST
var request = require('request');
// Set the headers
var headers = {
    'User-Agent':       'Super Agent/0.0.1',
    'Content-Type':     'application/x-www-form-urlencoded'
}

// Configure the request
var options = {
    url: 'http://hostforlife.eu',
    method: 'POST',
    headers: headers,
    form: {'key1': 'xxx', 'key2': 'yyy'}
}
// Start the request
request(options, function (error, response, body) {
    if (!error && response.statusCode == 200) {
        // Print out the response body
        console.log(body)
    }
})

Above code will do POST https://localhost:8080/ with key1=xxx&key2=yyy in the body.

Handling gzip encoding
To handle gzip encoded response, you will need the compress-buffer library.
var uncompress = require('compress-buffer').uncompress;
// Set the headers and options ...
request(options, function (error, response, body) {
    if (!error && response.statusCode == 200) {
        // Handle gzip
        var encoding = response.headers['content-encoding']
        if(encoding && encoding.indexOf('gzip')>=0) {
            body = uncompress(body);
        }
        body = body.toString('utf-8');
        // Print out the response body
        console.log(body)
        // If it is json
        var json_body = JSON.parse(body);
    }
})

HostForLIFE.eu Node.js Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



HostForLIFE.eu Proudly Launches Sitefinity 7.3 Hosting

clock January 26, 2015 10:13 by author Peter

HostForLIFE.eu, a leading web hosting provider, has leveraged its gold partner status with Microsoft to launch its latest Sitefinity 7.3 Hosting support.

European Recommended Windows and ASP.NET Spotlight Hosting Partner in Europe, HostForLIFE.eu, has announced the availability of new hosting plans that are optimized for the latest update of the Sitefinity 7.3 hosting technology.

HostForLIFE.eu supports Sitefinity 7.3 hosting on our latest Windows Server and this service is available to all our new and existing customers. Sitefinity 7.3 offers a natural extension to all customer SharePoint workflows and wrap a compelling presentation around client core business documents. Contextual task-oriented approach to organizing documentation on any topic.

HostForLIFE.eu hosts its servers in top class data centers that is located in Amsterdam, London, Paris and Seattle (US) to guarantee 99.9% network uptime. All data center feature redundancies in network connectivity, power, HVAC, security, and fire suppression. All hosting plans from HostForLIFE.eu include 24×7 support and 30 days money back guarantee. All hosting plans from HostForLIFE.eu include 24×7 support and 30 days money back guarantee. The customer can start hosting our Sitefinity 7.3  site on our environment from as just low €3.00/month only.

Sitefinity 7.3 is a Web Content and Experience Management Platform that enables business to engage, convert and retain customers through multiple channels. Sitefinity 7.3 is the only truly mobile web content management on the market that supports all three mobile strategies out of the box – responsive design, mobile apps and mobile sites.

Sitefinity 7.3’s intuitive user interface delights both developers and business users alike, making it a more efficient environment to get more work done faster. There’s no long training required, so even new non-technical users will be up and running in no time. Because it’s built on a modern code-base, Sitefinity is best equipped to meet the long term needs of today’s expanding businesses, including tackling challenges like mobile, ecommerce, multisite management, content personalization, and so much more.

HostForLIFE.eu is a popular online Windows based hosting service provider catering to those people who face such issues. The company has managed to build a strong client base in a very short period of time. It is known for offering ultra-fast, fully-managed and secured services in the competitive market. Our powerful servers are specially optimized and ensure Sitefinity 7.3 performance.

For more information about this new product, please visit http://hostforlife.eu/European-Sitefinity-73-Hosting

About HostForLIFE.eu :
HostForLIFE.eu is awarded Top No#1 SPOTLIGHT Recommended Hosting Partner by Microsoft (see http://www.asp.net/hosting/hostingprovider/details/953). Our service is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and other European countries. Besides this award, we have also won several awards from reputable organizations in the hosting industry and the detail can be found on our official website.



DotNetnuke 7.3.4 Hosting - HostForLIFE.eu :: How to Fix DotNetNuke Redirect Loop and 404 Not Found Error ?

clock January 13, 2015 05:40 by author Peter

This problem happens especially in the latest versions of DotNetNuke (7.0 or later). It is shortly represented like this: when you install DotNetNuke and everything appearance fine. You log in to your system using your host account and so your homepage keeps refreshing indefinitely. you'll not get rid of that “Getting Started” pop-up. after you manually instert the url of different pages in your web browser url bar (like yoursite.com/contact.aspx), you get a 404 not found error.

To solve this problem, apply the steps below:
1. Find the folder within which your DotNetNuke web site is installed and find your web.config file there and open it (normally, i open it with a development application like Visual Studio or notepad++ for better undestanding however classic Notepad can do fine, too).

2. On the web.config file, you should find the <system.webserver> tag.

3. On this tag, find <modules> tag. And update this tag:
<modules runAllManagedModulesForAllRequests=”true”>

4. Then, Save your web.config file. Close your browser, open it again and open your website. Log in with your host or admin account. You will see that the problem is fixed.

Obviously there may be different components which cause this issue yet i have made bunches of DNN establishments and i've generally figured out how to settle this issue by applying the steps above.

Note: If you have done all the steps and still get a 404 error, than check your default documents in IIS and see if there is default.aspx in there. If not, add it.



Node.js Hosting Spain - HostForLIFE.eu :: How to Make a Visitor Counter in Node.js ?

clock January 6, 2015 05:02 by author Peter

In this article we will actualize a basic hit counter application with a couple of lines of code. We should examine what we truly need to do. We might simply want to actualize a basic hit count for our web server. Case in point, we realize that in ASP.NET application variables are comprehensively shareable and static in nature, as it were if a client changes a worth then all clients will see the changed variant.

In our case we will count the quantity of hits in our web server, and trust me, its much less difficult than you would anticipate. I will assume that the Node.Js server is already up and running in our system. Let’s take a look at the following code.
var http = require('http');
var userCount = 0;
var server = http.createServer(function (req, res) {
    userCount++;
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.write('Hello!\n');
    res.write('We have had ' + userCount + ' visits!\n');
    res.end(); 
});
server.listen(9090);
console.log('server running...')

The illustration is exceptionally straightforward with our past Hello World case. In this case we have pronounced one global variable that is including the quantity of hits our web application. In the server body, from the beginning we are increasing the variable worth and afterward we are sending the quality as a reaction in the wake of setting 200 reaction statuses.

We should run the application. Go to the Command Prompt and explore to your server area. At that point fire the summon:
hub <server filename>

We are seeing that our node server is running. Presently we will go to a program and attempt to get to the server.

At the outset hit, we see that its demonstrating that this is the first HTTP solicitation to our server. Presently, in the event that we hit a few more times then we will see that the number has changed as in the accompanying.

It's demonstrating the quantity of HTTP demands after the node server was up and running. The inquiry may ring a bell, for every single hit, why is the variable not introduced? The reason is, the node.js prepare any work in occasion circle system.

When we make the server and it is up, it will never stop and it will keep on listening for events. For our situation the server is listening for request and response events. Along these lines, when we make one HTTP demand , it executes the code that is composed inside the occasion scope and since we have announced a variable out of this extension, it is never instated the second time.

Conclusion
In this short article we have figured out how to execute a hit counter in a HTTP server utilizing a couple of lines of code. I trust this useful illustration will support you in your node.js day. Happy Coding!



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in