Before you begin, make sure you have Node.js and npm installed on your system. If you don’t have them yet, you can download them from the official Node.js website.

Setting up Express

To use Express, you need to install it on your system. Run the following command:

npm install express

This command installs the express package on your system, which allows you to use Express in your terminal.

Creating an Express Project

To create a new Express project, you can start by creating a new file and writing the following code:

// Importing the Express module
const express = require('express');

// Creating a new Express application
const app = express();

// Setting the port to 80
// Port 80 is the default port for HTTP traffic.
const port = 80;

// Defining a route handler for the route '/'
// This route handler sends 'Hello World!' when accessed.
app.get('/', (req, res) => {
  res.send('Hello World!');

// Making our Express application listen on port 80
app.listen(port, () => {
  // This block of code will run once the server is listening on port 80
  console.log(`Example app listening on port ${port}`);

Creating the squarecloud config file

Learn about: how to make the configuration file for Square Cloud.

The file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things.

Configuring the START Field

In the Square Cloud configuration file, the START field is optional and is only necessary if you are using a custom script to start the website. In the example provided, the START field is not necessary.

Purchasing a Plan Before Uploading Your Project

Before you can upload your project to Square Cloud, it’s important to understand that you need to purchase a plan. The type of plan you choose will depend on the resources required by your application. You can view our plans here.

Are you wondering how much RAM and CPU your plan needs to host an Express application? Don’t worry, we’re here to help. Express.js is a framework for Node.js that provides minimal features for web server construction. It’s easy to learn, highly flexible, and suitable for a wide range of applications, making it a great choice for web development. Our Standard plan offers 4GB of RAM and 1vCPU, which should be sufficient for most Express applications. However, if you’re working on a larger project or need more stability, we recommend considering our Pro plan. With additional resources, you can ensure smooth performance even under high demand. To purchase, simply click here.

Uploading Your App to Square Cloud

After following all the steps, package your application files into a zip file where the configuration file is and upload the application on Upload. Remember not to include files like node_modules. You can get more information about unnecessary files when hosting at automatic-deletion-files-when-deploying-an-application-to-squarecloud.


Additional Resources

For more information about Express and its tools, visit the official Express documentation. There, you’ll find detailed guides, tutorials, and API documentation to help you make the most of Express.

If you continue to experience any issues, please don’t hesitate to contact our support team.