Install Express on your POWER web hosting plan
Find out how to install Express on your POWER web hosting plan
Find out how to install Express on your POWER web hosting plan
Last updated 4th February 2021
You've subscribed to a Web POWER web hosting plan to deploy Node.js applications, and you want to begin developing your project using Express.
This guide will explain how to deploy a simple Hello World server on Express.
Find out how to install Express on your POWER web hosting plan.
If you have just started to use your Web POWER web hosting plan, we suggest to have a look at our Getting started with a POWER web hosting plan guide before going further.
Let's suppose you have the default configuration for Node.js hosting:
To verify your configuration, you can use the Retrieve active configuration API endpoint.
Connect via SSH to your POWER web hosting, and install Express using npm
:
npm install express --save
Then go to the www
folder and create an index.js
file there:
index.js
const express = require('express');
const port = 3000;
const msg = `Hello World from NodeJS ${process.version}\n`;
const app = express();app.get('/', function (req, res) {
res.send(msg);
});
app.listen(port);
Restart your instance and your Express Hello World will be online.
Terminal output:
~/www $ cd www
~/www $ node -v
v14.13.0
~/www $ npm install express --save
~/www $ vi index.js
const express = require('express');
const port = 3000;
const msg = `Hello World from NodeJS ${process.version}\n`;
const app = express();app.get('/', function (req, res) {
res.send(msg);
});
app.listen(port);
~/www $ mkdir -p tmp
~/www $ touch tmp/restart.txt
Join our community of users on https://community.ovh.com/en/.
Join our Gitter room to discuss directly with the POWER Web Hosting team and the other users of this lab.
Please feel free to give any suggestions in order to improve this documentation.
Whether your feedback is about images, content, or structure, please share it, so that we can improve it together.
Your support requests will not be processed via this form. To do this, please use the "Create a ticket" form.
Thank you. Your feedback has been received.
Access your community space. Ask questions, search for information, post content, and interact with other OVHcloud Community members.
Discuss with the OVHcloud community