<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Node JS on Mwongera Evans</title><link>https://mwongera.online/posts/</link><description>Recent content in Node JS on Mwongera Evans</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 24 May 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://mwongera.online/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Deploying node applications and maintaining uptime</title><link>https://mwongera.online/posts/deploying-nodejs/</link><pubDate>Wed, 24 May 2023 00:00:00 +0000</pubDate><guid>https://mwongera.online/posts/deploying-nodejs/</guid><description>When you’re faced with deploying a web application, you’ll find yourself considering where to host it. You’ll want to consider how to monitor your application and keep it running. You may also wonder what you can do to make it as fast as possible. In this article, you’ll get an overview of how to address these concerns for your Node web application.
1. Hosting Node applications Most web application developers are familiar with PHP-based applications.</description></item><item><title>Accepting user input from forms</title><link>https://mwongera.online/posts/accepting-user-input-from-forms/</link><pubDate>Thu, 04 Feb 2021 00:00:00 +0000</pubDate><guid>https://mwongera.online/posts/accepting-user-input-from-forms/</guid><description>In this section you’ll learn how to
Handle submitted form fields Handle uploaded files using formidable Calculate upload progress in real time Handling submitted form fields
Typically two Content-Type values are associated with form submission requests:
application/x-www-form-urlencoded—The default for HTML forms multipart/form-data—Used when the form contains files, or non-ASCII or binary data In this section, you’ll rewrite the to-do list application from the previous section to utilize a form and a web browser.</description></item><item><title>Building a RESTful web service</title><link>https://mwongera.online/posts/rest-api/</link><pubDate>Thu, 04 Feb 2021 00:00:00 +0000</pubDate><guid>https://mwongera.online/posts/rest-api/</guid><description>By convention, HTTP verbs, such as GET, POST, PUT, and DELETE, are mapped to retrieving, creating, updating, and removing the resources specified by the URL. RESTful web services have gained in popularity because they’re simple to utilize and implement in comparison to protocols such as the Simple Object Access Protocol (SOAP).
We'll use cURL (http://curl.haxx.se/download.html) in place of a web browser to interact with our web service.
To create a compliant REST server, you need to implement the 4 HTTP verbs.</description></item><item><title>How to Setup a GraphQL, Express and postgreSQL Server</title><link>https://mwongera.online/posts/express-js-intro/</link><pubDate>Thu, 04 Feb 2021 00:00:00 +0000</pubDate><guid>https://mwongera.online/posts/express-js-intro/</guid><description>To sart here are some advantages of using graphql:
Avoids having to create many routes to handle everything Avoids over-fetching and under-fetching data This works concurrently with API routes so the server can still be RESTful Install devDependencies
npm init -y
npm install @babel/core @babel/node @babel/preset-env nodemon --save-dev
Setting Up the Express server
First thing to do is install express and make an index.js file
npm install express
This server will be using the Hello World!</description></item><item><title>Securing your application with HTTPS</title><link>https://mwongera.online/posts/securing-app-with-https/</link><pubDate>Thu, 04 Feb 2021 00:00:00 +0000</pubDate><guid>https://mwongera.online/posts/securing-app-with-https/</guid><description>In this section you’ll learn how to secure you application with https
If you’d like to take advantage of HTTPS in your Node application, the first step is getting a private key and a certificate. The private key is, essentially, a “secret” needed to decrypt data sent between the server and client. The private key is kept in a file on the server in a place where it can’t be easily accessed by untrusted users.</description></item><item><title>Serving static files</title><link>https://mwongera.online/posts/serving-static-files/</link><pubDate>Thu, 04 Feb 2021 00:00:00 +0000</pubDate><guid>https://mwongera.online/posts/serving-static-files/</guid><description>In this section you’ll learn how to
Create a simple static file server Optimize the data transfer with pipe() Handle user and filesystem errors by setting the status code. Let’s start by creating a basic HTTP server for serving static assets.
Creating a static server
Traditional HTTP servers like Apache and IIS are first and foremost file servers. You might currently have one of these file servers running on an old website, and moving it over to Node, replicating this basic functionality, is an excellent exercise to help you better understand the HTTP servers you’ve probably used in the past.</description></item></channel></rss>