<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nodejs Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/nodejs/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/nodejs/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Thu, 27 Nov 2025 14:50:09 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>Nodejs Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/nodejs/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Deploy Ghost the Immutable Way on Clever Cloud</title>
		<link>https://www.clever.cloud/blog/features/2019/10/21/ghost-hosting-clever-cloud/</link>
		
		<dc:creator><![CDATA[Laurent Doguin]]></dc:creator>
		<pubDate>Mon, 21 Oct 2019 17:05:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Nodejs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2019/10/21/ghost-hosting-clever-cloud/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="deploy ghost 1" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>I am currently on a personal quest for a self hosted blog platform that <em>just work</em>. So might you see more posts about blog platform. And the first candidate I wanted to try is Ghost, since it's advertised as the natural successor to Wordpress(Because yes I don't want Wordpress, It's too old and I am in tech so I just can't).

<span id="more-2966"></span>

Ghost is in their own words:
<blockquote>A fully open source, adaptable platform for building and running a modern online publication. We power blogs, magazines and journalists from Zappos to Sky News.</blockquote>
Sounds promising, let's dig in. It's written in NodeJS, and it requires MySQL. Should work right off the bat on Clever Cloud. That is if they follow an immutable approach to production deployment. And as it turns out, they don't really do that. It's even harder if you try to stick to recommended production tools and methods. So it <em>might</em> be a little more complicated than I thought at the begining. But it ended up working fine. Here's how.
<h2 id="your-local-blog-installation">Your local blog installation</h2>
The first thing to do is create your blog locally. Ghost comes with a CLI tool you can install with npm or yarn. I am using npm so <code>npm install -g ghost-cli</code>. Then simply create a folder, change directory and install a Ghost blog:
<pre><code class="language-bash">mkdir myblog
cd myblog
ghost install local
</code></pre>
You should see some logs and right at the end an invitation to go to <code>http://localhost:2368/ghost/</code>. This is your new blog. You should go through a configuration wizard to setup everything. It's using the development configuration right now, with a local SQL lite database and logs written to disk. Now you can stop the local blog by running <code>ghost stop</code>.

If you list the content of your directory you should see the following:
<pre><code class="language-bash">[ldoguin@caolila:~/myblog]$ ls
content/  current@  versions/  config.development.json
</code></pre>
All the specifics of your blog are stored in <code>content</code>. <code>current</code> is a symbolic link to the latest Ghost release downloaded in the <code>versions</code> folder. There is another symbolic link in <code>content/themes/casper</code> that points to the latest capser theme built in Ghost. This link will likely be broken once the blog is pushed to Clever Cloud because of the way we will install Ghost on it. So what you can do right now is replace that link with the actual content of the theme, and add a couple of other themes for good measure. It's also the time to create our git repository. Because the new themes are going to be <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">git submodules</a>. This way it can easily be updated, while controlling the version.
<pre><code class="language-bash">rm content/themes/casper/
cp -r current/content/themes/casper/ content/themes/
git init
cd content/themes/
git submodule add https://github.com/curiositry/mnml-ghost-theme
git submodule add https://github.com/zutrinken/attila/
</code></pre>
To test the new theme let's start Ghost in debug mode: <code>ghost run -D</code>. If you go back to the admin page under <code>http://localhost:2368/ghost/</code>, click on the Design tab and you will see your new installed themes at the end of the page. Once you are done you can stop the server by simply hitting <em>Ctrl-c</em>.

Now you have a running installation locally, let's see how to move it to the Cloud.
<h2 id="your-blog-on-clever-cloud">Your blog on Clever Cloud</h2>
To interact with Clever Cloud I recomment using our wonderful CLI clever-tools available easily on most distributions as you can see in our <a href="https://github.com/CleverCloud/clever-tools#installation">documentation</a>. This is the tool I will use in the example. You can of course do the same thing using Clever Cloud's Web Console.

In a terminal, inside your blog folder, run the following command:
<pre><code class="language-bash">clever create --type node myblog # create a node application
clever addon create mysql-addon --plan s_sml myblogsql # create a MySQL database
clever service link-addon myblogsql # Link the database to the application
clever env set NODE_ENV production # setup environment variable for production
clever env set CC_PRE_RUN_HOOK ./clevercloud.sh # run a specific script before the build phase
clever domain add mysuperblog.cleverapps.io # Add a test domain name
</code></pre>
Now there is an existing application and a database on Clever Cloud, configured to run Ghost. But then we still need to create a bunch of files.
<h3 id="installing-ghost-for-your-clever-cloud-application">Installing Ghost for your Clever Cloud Application</h3>
You have seen in the previous step an envionment variable pointing to a <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">pre run hook</a>. It allows us run arbitrary code before the build phase. So let's create that executable file with <code>touch clevercloud.sh</code> and <code>chmod +x clevercloud.sh</code> at the root of our repository. And as for the content here it is:
<pre><code class="language-bash">#!/bin/sh
npm install -g ghost-cli # install ghost-cli on Clever Cloud
mkdir ghost # create a folder for a new local instance of Ghost
cd ghost
ghost install local
ghost stop
cp ../config.production.json . # copy the production configuration
</code></pre>
After that script we will have installed <em>ghost-cli</em> and the latest version of Ghost available. This script can be modified to have a specific version installed if you wanted to. But the thing is I like using upstream code: fail eary, fail often. Now on to the actual configuration.
<h3 id="configure-ghost-for-production">Configure Ghost for Production</h3>
To configure Ghost you have two options. You can use a json file or environment variable. Here I am using a mix of two. Things that won't change when deploying on Clever Cloud are going in the file. Things that may change, like the database used or the url, will be configured as environment variables.

Let's start with the configuration file. You can copy the existing development file or create a brand new one with <code>touch config.production.json</code>. And here's the content:
<pre><code class="language-json">{
  "server": {
    "port": 8080,
    "host": "0.0.0.0"
  },
  "database": {
    "client": "mysql"
  },
  "mail": {
    "transport": "Direct"
  },
  "process": "local",
  "logging": {
    "level": "debug",
    "transports": [
      "stdout"
    ]
  },
  "paths": {
    "contentPath": "../../../content/"
  }
}
</code></pre>
In this file you can see that the only logging transport used is <em>stdout</em>. As Clever Cloud uses Immutable infrastructure and might restart your application when needed, writing logs on file is pointless as they may be lost. Writing them in the standard output is what we advize and you can always configure <a href="https://www.clever.cloud/developers/clever-cloud-apis/add-ons-log-collector/">log drains</a> if you want to use a third party log management tool. Database client is rightly set to <em>mysql</em>. Something else that is changing from the developer configuration is the <em>contentPath</em>. It's the path to your specific Ghost data, themes, assts, etc.. This is the folder where the themes are installed for instance. You can give an absolute or relative path. I'am using the relative path. And it starts in the running Ghost instance. In our case the Ghost version is installed by <code>/clevercloud.sh</code> in <code>/ghost/versions/versionUsed/</code> and our content is available in <code>/content/</code>. So we need to go up three directories to make sure it founds our <code>content</code> folder.

And here is the list of environment variables. I have copy pasted the database values from the result of the <code>clever env</code> command.
<pre><code class="language-bash">clever env set database__connection__host btxgsb7xrhkuydlmb3zr-mysql.services.clever-cloud.com
clever env set database__connection__user ukf6bzfjgd2eg0iw
clever env set database__connection__password 87xRmGJljF3aSgGullm
clever env set database__connection__database btxgsb7xrhkuydlmb3zr
clever env set database__connection__port 20222
clever env set url https://mysuperblog.cleverapps.io/
</code></pre>
At this point we have a properly configured Ghost instance using our own set of files. Now the question is how do you run it ?
<h3 id="run-ghost">Run Ghost</h3>
With node-js applications deployed on Clever Cloud we usually run the <em>main</em> or <em>start</em> field available in package.json. So what we can do is create it with <code>touch package.json</code> and add a start field that will run the blog with ghost-cli:
<pre><code class="language-json">{
    "name": "ghost",
    "version": "0.1.0",
    "description": "",
    "scripts": {
        "start": "ghost run --dir ghost"
    },
    "devDependencies": {
    },
    "dependencies": {
    }
}
</code></pre>
Here we have a configured, ready to run Ghost instance. To deploy on Clever Cloud we push code to a remote git branch. We need to do our first commit but first a bit of cleanup.
<h3 id="ignoring-local-development-files">Ignoring local development files</h3>
There are a bunch of files we should not add to our git repository. Basically all the files related to our local deployment. So I added them to a <code>.gitignore</code> file and invite you to do the same.
<pre><code class="language-gitignore">.ghost-cli
config.development.json
current
versions
</code></pre>
<h3 id="git-push-to-production">Git push to Production</h3>
Now you should have a fairly simple git add to do:
<pre><code class="language-bash">git add clevercloud.sh package.json config.production.json content
git commit -m "Initial commit"
clever deploy
</code></pre>
If you go to <a href="https://mysuperblog.cleverapps.io/ghost/">https://mysuperblog.cleverapps.io/ghost/</a> you will run through the setup again, but this time storing things in the MySQL database. Take a look at the <a href="https://ghost.org/docs/concepts/config/">configuration options</a> for Ghost, there are still a bunch of things you can do like setting up a proper email SMTP server.

And what about the traditional Production configuration from Ghost's documentaiton like SSL Configuration, reverse proxy and such? Well the beauty of using Clever Cloud is that everything is taken care of for you. Nothing else to do.

And there you have it, your new blog is online. Deployed the immutable way.]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="deploy ghost 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/deploy-ghost-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>I am currently on a personal quest for a self hosted blog platform that <em>just work</em>. So might you see more posts about blog platform. And the first candidate I wanted to try is Ghost, since it's advertised as the natural successor to Wordpress(Because yes I don't want Wordpress, It's too old and I am in tech so I just can't).

<span id="more-2966"></span>

Ghost is in their own words:
<blockquote>A fully open source, adaptable platform for building and running a modern online publication. We power blogs, magazines and journalists from Zappos to Sky News.</blockquote>
Sounds promising, let's dig in. It's written in NodeJS, and it requires MySQL. Should work right off the bat on Clever Cloud. That is if they follow an immutable approach to production deployment. And as it turns out, they don't really do that. It's even harder if you try to stick to recommended production tools and methods. So it <em>might</em> be a little more complicated than I thought at the begining. But it ended up working fine. Here's how.
<h2 id="your-local-blog-installation">Your local blog installation</h2>
The first thing to do is create your blog locally. Ghost comes with a CLI tool you can install with npm or yarn. I am using npm so <code>npm install -g ghost-cli</code>. Then simply create a folder, change directory and install a Ghost blog:
<pre><code class="language-bash">mkdir myblog
cd myblog
ghost install local
</code></pre>
You should see some logs and right at the end an invitation to go to <code>http://localhost:2368/ghost/</code>. This is your new blog. You should go through a configuration wizard to setup everything. It's using the development configuration right now, with a local SQL lite database and logs written to disk. Now you can stop the local blog by running <code>ghost stop</code>.

If you list the content of your directory you should see the following:
<pre><code class="language-bash">[ldoguin@caolila:~/myblog]$ ls
content/  current@  versions/  config.development.json
</code></pre>
All the specifics of your blog are stored in <code>content</code>. <code>current</code> is a symbolic link to the latest Ghost release downloaded in the <code>versions</code> folder. There is another symbolic link in <code>content/themes/casper</code> that points to the latest capser theme built in Ghost. This link will likely be broken once the blog is pushed to Clever Cloud because of the way we will install Ghost on it. So what you can do right now is replace that link with the actual content of the theme, and add a couple of other themes for good measure. It's also the time to create our git repository. Because the new themes are going to be <a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">git submodules</a>. This way it can easily be updated, while controlling the version.
<pre><code class="language-bash">rm content/themes/casper/
cp -r current/content/themes/casper/ content/themes/
git init
cd content/themes/
git submodule add https://github.com/curiositry/mnml-ghost-theme
git submodule add https://github.com/zutrinken/attila/
</code></pre>
To test the new theme let's start Ghost in debug mode: <code>ghost run -D</code>. If you go back to the admin page under <code>http://localhost:2368/ghost/</code>, click on the Design tab and you will see your new installed themes at the end of the page. Once you are done you can stop the server by simply hitting <em>Ctrl-c</em>.

Now you have a running installation locally, let's see how to move it to the Cloud.
<h2 id="your-blog-on-clever-cloud">Your blog on Clever Cloud</h2>
To interact with Clever Cloud I recomment using our wonderful CLI clever-tools available easily on most distributions as you can see in our <a href="https://github.com/CleverCloud/clever-tools#installation">documentation</a>. This is the tool I will use in the example. You can of course do the same thing using Clever Cloud's Web Console.

In a terminal, inside your blog folder, run the following command:
<pre><code class="language-bash">clever create --type node myblog # create a node application
clever addon create mysql-addon --plan s_sml myblogsql # create a MySQL database
clever service link-addon myblogsql # Link the database to the application
clever env set NODE_ENV production # setup environment variable for production
clever env set CC_PRE_RUN_HOOK ./clevercloud.sh # run a specific script before the build phase
clever domain add mysuperblog.cleverapps.io # Add a test domain name
</code></pre>
Now there is an existing application and a database on Clever Cloud, configured to run Ghost. But then we still need to create a bunch of files.
<h3 id="installing-ghost-for-your-clever-cloud-application">Installing Ghost for your Clever Cloud Application</h3>
You have seen in the previous step an envionment variable pointing to a <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">pre run hook</a>. It allows us run arbitrary code before the build phase. So let's create that executable file with <code>touch clevercloud.sh</code> and <code>chmod +x clevercloud.sh</code> at the root of our repository. And as for the content here it is:
<pre><code class="language-bash">#!/bin/sh
npm install -g ghost-cli # install ghost-cli on Clever Cloud
mkdir ghost # create a folder for a new local instance of Ghost
cd ghost
ghost install local
ghost stop
cp ../config.production.json . # copy the production configuration
</code></pre>
After that script we will have installed <em>ghost-cli</em> and the latest version of Ghost available. This script can be modified to have a specific version installed if you wanted to. But the thing is I like using upstream code: fail eary, fail often. Now on to the actual configuration.
<h3 id="configure-ghost-for-production">Configure Ghost for Production</h3>
To configure Ghost you have two options. You can use a json file or environment variable. Here I am using a mix of two. Things that won't change when deploying on Clever Cloud are going in the file. Things that may change, like the database used or the url, will be configured as environment variables.

Let's start with the configuration file. You can copy the existing development file or create a brand new one with <code>touch config.production.json</code>. And here's the content:
<pre><code class="language-json">{
  "server": {
    "port": 8080,
    "host": "0.0.0.0"
  },
  "database": {
    "client": "mysql"
  },
  "mail": {
    "transport": "Direct"
  },
  "process": "local",
  "logging": {
    "level": "debug",
    "transports": [
      "stdout"
    ]
  },
  "paths": {
    "contentPath": "../../../content/"
  }
}
</code></pre>
In this file you can see that the only logging transport used is <em>stdout</em>. As Clever Cloud uses Immutable infrastructure and might restart your application when needed, writing logs on file is pointless as they may be lost. Writing them in the standard output is what we advize and you can always configure <a href="https://www.clever.cloud/developers/clever-cloud-apis/add-ons-log-collector/">log drains</a> if you want to use a third party log management tool. Database client is rightly set to <em>mysql</em>. Something else that is changing from the developer configuration is the <em>contentPath</em>. It's the path to your specific Ghost data, themes, assts, etc.. This is the folder where the themes are installed for instance. You can give an absolute or relative path. I'am using the relative path. And it starts in the running Ghost instance. In our case the Ghost version is installed by <code>/clevercloud.sh</code> in <code>/ghost/versions/versionUsed/</code> and our content is available in <code>/content/</code>. So we need to go up three directories to make sure it founds our <code>content</code> folder.

And here is the list of environment variables. I have copy pasted the database values from the result of the <code>clever env</code> command.
<pre><code class="language-bash">clever env set database__connection__host btxgsb7xrhkuydlmb3zr-mysql.services.clever-cloud.com
clever env set database__connection__user ukf6bzfjgd2eg0iw
clever env set database__connection__password 87xRmGJljF3aSgGullm
clever env set database__connection__database btxgsb7xrhkuydlmb3zr
clever env set database__connection__port 20222
clever env set url https://mysuperblog.cleverapps.io/
</code></pre>
At this point we have a properly configured Ghost instance using our own set of files. Now the question is how do you run it ?
<h3 id="run-ghost">Run Ghost</h3>
With node-js applications deployed on Clever Cloud we usually run the <em>main</em> or <em>start</em> field available in package.json. So what we can do is create it with <code>touch package.json</code> and add a start field that will run the blog with ghost-cli:
<pre><code class="language-json">{
    "name": "ghost",
    "version": "0.1.0",
    "description": "",
    "scripts": {
        "start": "ghost run --dir ghost"
    },
    "devDependencies": {
    },
    "dependencies": {
    }
}
</code></pre>
Here we have a configured, ready to run Ghost instance. To deploy on Clever Cloud we push code to a remote git branch. We need to do our first commit but first a bit of cleanup.
<h3 id="ignoring-local-development-files">Ignoring local development files</h3>
There are a bunch of files we should not add to our git repository. Basically all the files related to our local deployment. So I added them to a <code>.gitignore</code> file and invite you to do the same.
<pre><code class="language-gitignore">.ghost-cli
config.development.json
current
versions
</code></pre>
<h3 id="git-push-to-production">Git push to Production</h3>
Now you should have a fairly simple git add to do:
<pre><code class="language-bash">git add clevercloud.sh package.json config.production.json content
git commit -m "Initial commit"
clever deploy
</code></pre>
If you go to <a href="https://mysuperblog.cleverapps.io/ghost/">https://mysuperblog.cleverapps.io/ghost/</a> you will run through the setup again, but this time storing things in the MySQL database. Take a look at the <a href="https://ghost.org/docs/concepts/config/">configuration options</a> for Ghost, there are still a bunch of things you can do like setting up a proper email SMTP server.

And what about the traditional Production configuration from Ghost's documentaiton like SSL Configuration, reverse proxy and such? Well the beauty of using Clever Cloud is that everything is taken care of for you. Nothing else to do.

And there you have it, your new blog is online. Deployed the immutable way.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>One Framework a Day keeps the Boredom Away: Express</title>
		<link>https://www.clever.cloud/blog/features/2017/10/13/1fdba-express/</link>
		
		<dc:creator><![CDATA[Laurent Doguin]]></dc:creator>
		<pubDate>Fri, 13 Oct 2017 17:15:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[1fdba]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[Nodejs]]></category>
		<category><![CDATA[react]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2017/10/13/1fdba-express/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="1fdba express 1" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><p>Welcome to this new edition of <a href="/blog/features/2017/10/09/1fdba-step0/">One Framework a Day keeps the Boredom Away</a>. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it&#39;s about Express.</p>
<span id="more-2909"></span>

<p>In each post of this series we&#39;ll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at <a href="https://expressjs.com/">Express</a>.</p>
<p>If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI <a href="https://github.com/CleverCloud/clever-tools">Clever-Tools</a>.</p>
<h2 id="what-is-express">What is Express?</h2>
<blockquote>Fast, unopinionated, minimalist web framework for Node.js</blockquote>

<p>It&#39;s pretty much the default JavaScript framework for backend stuff. It&#39;s ridiculously simple to use and benefits from a great ecosystem. If you are thinking about a particular module, there&#39;s a good chance someone already wrote it. I found a project called <a href="https://realworld.io/">RealWorld</a>. They use a Medium clone as example application and have implemented it with a variety of backend and frontend frameworks. Today I will use it as an example with their <a href="https://github.com/gothinkster/node-express-realworld-example-app">Express, MondoDB backend</a> and their <a href="https://github.com/gothinkster/react-redux-realworld-example-app">React,Redux frontend</a>.</p>
<h2 id="setup">Setup</h2>
<p>Let&#39;s start by the backend. It&#39;s a Node.js application using MongoDB so I will need a Node.js application and a MongoDB add-on.</p>
<ul>
<li>Clone the backend: <code>git clone https://github.com/gothinkster/node-express-realworld-example-app</code></li>
<li>Get in the project: <code>cd node-express-realworld-example-app</code></li>
<li>Create the Node.js application: <code>clever create --type node realworld-express</code></li>
<li>Create the MongoDB addon: <code>clever addon create mongodb-addon --plan peanut realworld-mongodb</code></li>
<li>Link the database to the application: <code>clever service link-addon realworld-mongodb</code></li>
</ul>
<p>Great thing about this application is that it&#39;s already configurable with environment variable so we just have to set them up:</p>
<ul>
<li>Configure the MongoDB connection: <code>clever env set MONGODB_URI `clever env | awk  -F = &#39;/MONGODB_ADDON_URI/ { print $2}&#39;` </code></li>
<li>Set the production flag: <code>clever env set NODE_ENV production</code></li>
<li>Set the secret used by the app: <code>clever env set SECRET myVerySecretiveSecret</code></li>
<li>Add a domain name: <code>clever domain add realworldMongoExpress.cleverapps.io</code></li>
</ul>
<p>Which make your backend ready to be deployed :)</p>
<p>Moving on to the frontend.</p>
<ul>
<li>Clone the frontend: <code>git clone https://github.com/gothinkster/react-redux-realworld-example-app</code></li>
<li>Get in the project: <code>cd react-redux-realworld-example-app</code></li>
<li>Create the Node.js application: <code>clever create --type node realworld-frontend</code></li>
<li>Set the production flag: <code>clever env set NODE_ENV production</code></li>
</ul>
<p>Sadly this one requires a little tweaking to use environment variable for configuration. I have edited the file <code>src/agent.js</code> like so:</p>
<pre><code class="language-diff">- const API_ROOT = &#39;https://conduit.productionready.io/api&#39;;
+ const API_ROOT =  process.env.API_ROOT || &#39;https://conduit.productionready.io/api&#39;;
</code></pre>
<ul>
<li>Now I can configure the backend with <code>clever env set API_ROOT https://realworldMongoExpress.cleverapps.io/api</code></li>
</ul>
<p>Don&#39;t forget to commit your changes. And now you are ready to deploy :)</p>
<h2 id="deploy">Deploy</h2>
<p>Since it&#39;s a NodeJS application, the rule for deployment is simple. There has to be a <code>main</code> or <code>scripts.start</code> field in <code>package.json</code>. For the backend is ready so all you have to do is run <code>clever deploy</code>. That&#39;s it.</p>
<p>For the frontend we have a <code>scripts.start</code> but the <em>PORT</em> variable is hardcoded. So I simply removed it and commited my change:</p>
<pre><code class="language-diff">- &quot;start&quot;: &quot;cross-env PORT=4100 react-scripts start&quot;,
+ &quot;start&quot;: &quot;cross-env react-scripts start&quot;,
</code></pre>
<p>Now it&#39;s ready for deployment. Again running <code>clever deploy</code> is all you need. Run <code>clever open</code> and your Medium clone will open in your default browser.</p>
<p>Is that it? Yes if you are not expecting too much traffic. But maybe you are indeed expecting traffic. Or maybe you don&#39;t know. Both situation are fine because Clever Cloud provides automatic scaling. Let&#39;s say you want to have 2 VM for the backend. This can be configured like this:<code>clever scale --instances 2</code></p>
<p>If you are not sure about the frontend, you can setup a minimum of 2 and a maximum of 5 like this: <code>clever scale --min-instances 2 --max-instances 5</code></p>
<p>That&#39;s it. You have deployed a MongoDB/Express backend and a React/Redux frontend in production. And you are ready for high level of traffic :)</p>
]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="1fdba express 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/1fdba-express-1-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>Welcome to this new edition of <a href="/blog/features/2017/10/09/1fdba-step0/">One Framework a Day keeps the Boredom Away</a>. In this series I will show you how to deploy a particular framework on Clever Cloud every day until I want to go back to boredom. Today it&#39;s about Express.</p>
<span id="more-2909"></span>

<p>In each post of this series we&#39;ll see how to deploy a particular framework on Clever Cloud. Today we are taking a look at <a href="https://expressjs.com/">Express</a>.</p>
<p>If you want to tag along, make sure you have git, a Clever Cloud account and that you have installed our CLI <a href="https://github.com/CleverCloud/clever-tools">Clever-Tools</a>.</p>
<h2 id="what-is-express">What is Express?</h2>
<blockquote>Fast, unopinionated, minimalist web framework for Node.js</blockquote>

<p>It&#39;s pretty much the default JavaScript framework for backend stuff. It&#39;s ridiculously simple to use and benefits from a great ecosystem. If you are thinking about a particular module, there&#39;s a good chance someone already wrote it. I found a project called <a href="https://realworld.io/">RealWorld</a>. They use a Medium clone as example application and have implemented it with a variety of backend and frontend frameworks. Today I will use it as an example with their <a href="https://github.com/gothinkster/node-express-realworld-example-app">Express, MondoDB backend</a> and their <a href="https://github.com/gothinkster/react-redux-realworld-example-app">React,Redux frontend</a>.</p>
<h2 id="setup">Setup</h2>
<p>Let&#39;s start by the backend. It&#39;s a Node.js application using MongoDB so I will need a Node.js application and a MongoDB add-on.</p>
<ul>
<li>Clone the backend: <code>git clone https://github.com/gothinkster/node-express-realworld-example-app</code></li>
<li>Get in the project: <code>cd node-express-realworld-example-app</code></li>
<li>Create the Node.js application: <code>clever create --type node realworld-express</code></li>
<li>Create the MongoDB addon: <code>clever addon create mongodb-addon --plan peanut realworld-mongodb</code></li>
<li>Link the database to the application: <code>clever service link-addon realworld-mongodb</code></li>
</ul>
<p>Great thing about this application is that it&#39;s already configurable with environment variable so we just have to set them up:</p>
<ul>
<li>Configure the MongoDB connection: <code>clever env set MONGODB_URI `clever env | awk  -F = &#39;/MONGODB_ADDON_URI/ { print $2}&#39;` </code></li>
<li>Set the production flag: <code>clever env set NODE_ENV production</code></li>
<li>Set the secret used by the app: <code>clever env set SECRET myVerySecretiveSecret</code></li>
<li>Add a domain name: <code>clever domain add realworldMongoExpress.cleverapps.io</code></li>
</ul>
<p>Which make your backend ready to be deployed :)</p>
<p>Moving on to the frontend.</p>
<ul>
<li>Clone the frontend: <code>git clone https://github.com/gothinkster/react-redux-realworld-example-app</code></li>
<li>Get in the project: <code>cd react-redux-realworld-example-app</code></li>
<li>Create the Node.js application: <code>clever create --type node realworld-frontend</code></li>
<li>Set the production flag: <code>clever env set NODE_ENV production</code></li>
</ul>
<p>Sadly this one requires a little tweaking to use environment variable for configuration. I have edited the file <code>src/agent.js</code> like so:</p>
<pre><code class="language-diff">- const API_ROOT = &#39;https://conduit.productionready.io/api&#39;;
+ const API_ROOT =  process.env.API_ROOT || &#39;https://conduit.productionready.io/api&#39;;
</code></pre>
<ul>
<li>Now I can configure the backend with <code>clever env set API_ROOT https://realworldMongoExpress.cleverapps.io/api</code></li>
</ul>
<p>Don&#39;t forget to commit your changes. And now you are ready to deploy :)</p>
<h2 id="deploy">Deploy</h2>
<p>Since it&#39;s a NodeJS application, the rule for deployment is simple. There has to be a <code>main</code> or <code>scripts.start</code> field in <code>package.json</code>. For the backend is ready so all you have to do is run <code>clever deploy</code>. That&#39;s it.</p>
<p>For the frontend we have a <code>scripts.start</code> but the <em>PORT</em> variable is hardcoded. So I simply removed it and commited my change:</p>
<pre><code class="language-diff">- &quot;start&quot;: &quot;cross-env PORT=4100 react-scripts start&quot;,
+ &quot;start&quot;: &quot;cross-env react-scripts start&quot;,
</code></pre>
<p>Now it&#39;s ready for deployment. Again running <code>clever deploy</code> is all you need. Run <code>clever open</code> and your Medium clone will open in your default browser.</p>
<p>Is that it? Yes if you are not expecting too much traffic. But maybe you are indeed expecting traffic. Or maybe you don&#39;t know. Both situation are fine because Clever Cloud provides automatic scaling. Let&#39;s say you want to have 2 VM for the backend. This can be configured like this:<code>clever scale --instances 2</code></p>
<p>If you are not sure about the frontend, you can setup a minimum of 2 and a maximum of 5 like this: <code>clever scale --min-instances 2 --max-instances 5</code></p>
<p>That&#39;s it. You have deployed a MongoDB/Express backend and a React/Redux frontend in production. And you are ready for high level of traffic :)</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setup your Private Parse Server in Production</title>
		<link>https://www.clever.cloud/blog/features/2016/02/02/setup-your-private-parse-server-in-production/</link>
		
		<dc:creator><![CDATA[Arnaud Lefebvre]]></dc:creator>
		<pubDate>Tue, 02 Feb 2016 15:32:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[Nodejs]]></category>
		<category><![CDATA[parse]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2016/02/02/setup-your-private-parse-server-in-production/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/parse-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="parse 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/parse-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-1368x528.jpg 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><a href="https://parse.com">Parse</a> is a BaaS (Backend as a Service) for mobile applications. They provide a suite of cloud services for developers that are tightly coupled with SDKs for all the major client platforms.

Unfortunately, they are closing their services to new subscriptions and definitely on January 28, 2017. While this is bad news, they open-sourced their <a href="https://github.com/ParsePlatform/parse-server">backend</a> so that the community can continue the project.

<span id="more-2864"></span>

If you are already familiar with Parse, you will be happy to learn that the backend is written in Node.js and uses MongoDB as a database which are both easy to deploy on Clever Cloud.
<h2 id="parse-server">Parse Server</h2>
They published an example of a basic application using their backend <a href="https://github.com/ParsePlatform/parse-server-example">on Github</a>.
<h2 id="deploy-on-clever-cloud">Deploy on Clever Cloud</h2>
<ol>
 	<li>First, you need to clone this repository (or use an existing one) and modify the Parse Server instanciation:
<pre><code class="language-javascript">var api = new ParseServer({
  databaseURI: process.env.MONGODB_ADDON_URI, // Use the MongoDB URI
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.PARSE_APPID, // Use environment variable to set the APP_ID
  masterKey: process.env.PARSE_MASTERKEY // Use environment variable to set the PARSE_MASTERKEY
});
</code></pre>
</li>
 	<li>Open the <a href="https://console.clever-cloud.com">Clever Cloud Console</a>, create an account if you don't have one yet</li>
 	<li>Create a <a href="https://www.clever.cloud/developers/api/howto/">Node.js application and a MongoDB addon</a></li>
 	<li>Add these two <a href="https://www.clever.cloud/developers/doc/administrate/">environment variables</a>: <code>PARSE_APPID: &lt;parseAppID&gt;</code>, <code>PARSE_MASTERKEY: &lt;parseMasterKey&gt;</code></li>
 	<li>Follow the instructions about adding the remote to your local git repository</li>
 	<li>Deploy it: <code>git push clever master</code> and head to your application's logs</li>
</ol>
From there you can setup a custom domain name and start using it as you would on Parse!

Happy mobile development!]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/parse-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="parse 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/parse-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/parse-1-1368x528.jpg 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><a href="https://parse.com">Parse</a> is a BaaS (Backend as a Service) for mobile applications. They provide a suite of cloud services for developers that are tightly coupled with SDKs for all the major client platforms.

Unfortunately, they are closing their services to new subscriptions and definitely on January 28, 2017. While this is bad news, they open-sourced their <a href="https://github.com/ParsePlatform/parse-server">backend</a> so that the community can continue the project.

<span id="more-2864"></span>

If you are already familiar with Parse, you will be happy to learn that the backend is written in Node.js and uses MongoDB as a database which are both easy to deploy on Clever Cloud.
<h2 id="parse-server">Parse Server</h2>
They published an example of a basic application using their backend <a href="https://github.com/ParsePlatform/parse-server-example">on Github</a>.
<h2 id="deploy-on-clever-cloud">Deploy on Clever Cloud</h2>
<ol>
 	<li>First, you need to clone this repository (or use an existing one) and modify the Parse Server instanciation:
<pre><code class="language-javascript">var api = new ParseServer({
  databaseURI: process.env.MONGODB_ADDON_URI, // Use the MongoDB URI
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.PARSE_APPID, // Use environment variable to set the APP_ID
  masterKey: process.env.PARSE_MASTERKEY // Use environment variable to set the PARSE_MASTERKEY
});
</code></pre>
</li>
 	<li>Open the <a href="https://console.clever-cloud.com">Clever Cloud Console</a>, create an account if you don't have one yet</li>
 	<li>Create a <a href="https://www.clever.cloud/developers/api/howto/">Node.js application and a MongoDB addon</a></li>
 	<li>Add these two <a href="https://www.clever.cloud/developers/doc/administrate/">environment variables</a>: <code>PARSE_APPID: &lt;parseAppID&gt;</code>, <code>PARSE_MASTERKEY: &lt;parseMasterKey&gt;</code></li>
 	<li>Follow the instructions about adding the remote to your local git repository</li>
 	<li>Deploy it: <code>git push clever master</code> and head to your application's logs</li>
</ol>
From there you can setup a custom domain name and start using it as you would on Parse!

Happy mobile development!]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Meteor JS on Clever Cloud</title>
		<link>https://www.clever.cloud/blog/engineering/2015/04/22/meteor-js-on-clever-cloud/</link>
		
		<dc:creator><![CDATA[Arnaud Lefebvre]]></dc:creator>
		<pubDate>Wed, 22 Apr 2015 15:52:00 +0000</pubDate>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[meteor]]></category>
		<category><![CDATA[Nodejs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2015/04/22/meteor-js-on-clever-cloud/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="meteor banner wide 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-1368x528.jpg 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>Lately, a lot of developpers asked us about Meteorjs support on Clever Cloud. This is indeed a growing technology out there, so I decided to test it myself.</p>
<span id="more-2797"></span>

<h3 id="what-is-meteorjs-">What is Meteorjs ?</h3>
<p>Meteor.js is based on Nodejs and is a real-time cross-platform web application framework (Web, Android and iOS). One of its main features is to automatically propagate data changes to clients in real-time or even query the database from the client (well, the client has a cache of the database which will update the remote one). It is an easy framework to build reactive applications</p>
<h3 id="how-to-deploy-on-clever-cloud">How to deploy on Clever Cloud</h3>
<p>As an example of a large Meteor application, I will use <a href="https://github.com/TelescopeJS/Telescope">TelescopeJS</a>. It&#39;s a social news application you can configure the way you want. I&#39;ll use the version v0.14.2 since it does not require MongoDB 3.0. This is a version we will provide in a near future.</p>
<h4 id="1--clone">1- Clone</h4>
<p>So first, <code>git clone https://github.com/TelescopeJS/Telescope &amp;&amp; cd Telescope &amp;&amp; git checkout v0.14.2</code> and run it: <code>meteor run</code>. Then open <a href="http://localhost:3000">http://localhost:3000</a>, you should see the default page with some examples.</p>
<h4 id="2--install-and-build">2- Install and build</h4>
<p>To make it run on Clever Cloud, we have to make our own install script. This script will run when you deploy your application and build what&#39;s needed. Create an <code>install.sh</code> file and paste the following lines (or download it from <a href="https://raw.githubusercontent.com/CleverCloud/demo-meteorjs/master/install.sh">Github</a>):</p>
<pre><code class="language-bash">#! /bin/bash

# Current path
currentPath=$(realpath ./)

# Install Meteorjs
curl https://install.meteor.com/ | sh
export PATH=/home/bas/.meteor:$PATH

# Install demeteorizer
cd ~/ &amp;&amp; npm install demeteorizer

# Go back to our project
cd &quot;$currentPath&quot;

# Note: When using &quot;meteorhacks:npm&quot;
# to prevent the error: &quot;unknown package: npm-container&quot;
# (described in https://github.com/meteorhacks/npm/issues/49)
# uncomment the two following lines:
#meteor remove npm-container
#meteor run

# demeteorize the app
~/node_modules/.bin/demeteorizer -a &quot;my_app&quot; -o my_app/

# Go inside our demeteorized app to install modules
cd my_app/

# Install modules
npm install
</code></pre>
<p>This script will install Meteorjs on our platform, <a href="https://github.com/onmodulus/demeteorizer">demeteorize</a> the app (i.e. convert it as a regular node.js application) and install its modules. If you are using the package <a href="https://github.com/meteorhacks/npm">npm-container</a> from <code>meteorhacks</code>, you HAVE to uncomment lines 20 and 21 (this is not our case here). Do not forget to do a <code>chmod +x install.sh</code> to give it execution rights.</p>
<p>Now we have to create our package.json (which is the file which describe your application for NPM): <code>npm init</code>. Open it and create a <code>scripts</code> section:</p>
<pre><code class="language-javascript">&quot;scripts&quot;:{
  &quot;install&quot;: &quot;./install.sh&quot;,
  &quot;start&quot;: &quot;node my_app/main.js&quot;
}
</code></pre>
<p>(<code>my_app/main.js</code> is a file generated by demeteorizer, do not modify this line)</p>
<p>Then, you can commit your changes: <code>git add package.json install.sh &amp;&amp; git commit -m &quot;Clever Cloud setup&quot;</code></p>
<h3 id="configuration">Configuration</h3>
<p>Once done, we need to create a Node.js application and a MongoDB addon  and configure it. Open the <a href="https://console.clever-cloud.com">dashboard</a> and:</p>
<h4 id="addon">Addon</h4>
<ul>
<li>Add an addon</li>
<li>Select MongoDB, choose your plan and name it.</li>
<li>Click it in the blue pane on your left, go into its configuration tab and copy somewhere the <code>Connection URI</code> field</li>
</ul>
<h4 id="application">Application</h4>
<ul>
<li>Add an application</li>
<li>Choose node.js for the language</li>
<li>Choose the scalers you want (the default configuration is enough most of the time)</li>
<li>Name it</li>
<li>We don&#39;t need an addon since we&#39;ve just created it</li>
<li>Environment variables: You have to create 2 of them: ROOT_URL (url of you application) and MONGO_URL (the <code>Connection URI</code> field you saved)</li>
<li>Follow instructions to add the remote repository, <code>git push</code> and it will deploy.</li>
</ul>
<p>Your application should now be deployed, feel free to contact our support if you have any troubles!</p>
]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="meteor banner wide 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/08/meteor-banner-wide-1-1368x528.jpg 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>Lately, a lot of developpers asked us about Meteorjs support on Clever Cloud. This is indeed a growing technology out there, so I decided to test it myself.</p>
<span id="more-2797"></span>

<h3 id="what-is-meteorjs-">What is Meteorjs ?</h3>
<p>Meteor.js is based on Nodejs and is a real-time cross-platform web application framework (Web, Android and iOS). One of its main features is to automatically propagate data changes to clients in real-time or even query the database from the client (well, the client has a cache of the database which will update the remote one). It is an easy framework to build reactive applications</p>
<h3 id="how-to-deploy-on-clever-cloud">How to deploy on Clever Cloud</h3>
<p>As an example of a large Meteor application, I will use <a href="https://github.com/TelescopeJS/Telescope">TelescopeJS</a>. It&#39;s a social news application you can configure the way you want. I&#39;ll use the version v0.14.2 since it does not require MongoDB 3.0. This is a version we will provide in a near future.</p>
<h4 id="1--clone">1- Clone</h4>
<p>So first, <code>git clone https://github.com/TelescopeJS/Telescope &amp;&amp; cd Telescope &amp;&amp; git checkout v0.14.2</code> and run it: <code>meteor run</code>. Then open <a href="http://localhost:3000">http://localhost:3000</a>, you should see the default page with some examples.</p>
<h4 id="2--install-and-build">2- Install and build</h4>
<p>To make it run on Clever Cloud, we have to make our own install script. This script will run when you deploy your application and build what&#39;s needed. Create an <code>install.sh</code> file and paste the following lines (or download it from <a href="https://raw.githubusercontent.com/CleverCloud/demo-meteorjs/master/install.sh">Github</a>):</p>
<pre><code class="language-bash">#! /bin/bash

# Current path
currentPath=$(realpath ./)

# Install Meteorjs
curl https://install.meteor.com/ | sh
export PATH=/home/bas/.meteor:$PATH

# Install demeteorizer
cd ~/ &amp;&amp; npm install demeteorizer

# Go back to our project
cd &quot;$currentPath&quot;

# Note: When using &quot;meteorhacks:npm&quot;
# to prevent the error: &quot;unknown package: npm-container&quot;
# (described in https://github.com/meteorhacks/npm/issues/49)
# uncomment the two following lines:
#meteor remove npm-container
#meteor run

# demeteorize the app
~/node_modules/.bin/demeteorizer -a &quot;my_app&quot; -o my_app/

# Go inside our demeteorized app to install modules
cd my_app/

# Install modules
npm install
</code></pre>
<p>This script will install Meteorjs on our platform, <a href="https://github.com/onmodulus/demeteorizer">demeteorize</a> the app (i.e. convert it as a regular node.js application) and install its modules. If you are using the package <a href="https://github.com/meteorhacks/npm">npm-container</a> from <code>meteorhacks</code>, you HAVE to uncomment lines 20 and 21 (this is not our case here). Do not forget to do a <code>chmod +x install.sh</code> to give it execution rights.</p>
<p>Now we have to create our package.json (which is the file which describe your application for NPM): <code>npm init</code>. Open it and create a <code>scripts</code> section:</p>
<pre><code class="language-javascript">&quot;scripts&quot;:{
  &quot;install&quot;: &quot;./install.sh&quot;,
  &quot;start&quot;: &quot;node my_app/main.js&quot;
}
</code></pre>
<p>(<code>my_app/main.js</code> is a file generated by demeteorizer, do not modify this line)</p>
<p>Then, you can commit your changes: <code>git add package.json install.sh &amp;&amp; git commit -m &quot;Clever Cloud setup&quot;</code></p>
<h3 id="configuration">Configuration</h3>
<p>Once done, we need to create a Node.js application and a MongoDB addon  and configure it. Open the <a href="https://console.clever-cloud.com">dashboard</a> and:</p>
<h4 id="addon">Addon</h4>
<ul>
<li>Add an addon</li>
<li>Select MongoDB, choose your plan and name it.</li>
<li>Click it in the blue pane on your left, go into its configuration tab and copy somewhere the <code>Connection URI</code> field</li>
</ul>
<h4 id="application">Application</h4>
<ul>
<li>Add an application</li>
<li>Choose node.js for the language</li>
<li>Choose the scalers you want (the default configuration is enough most of the time)</li>
<li>Name it</li>
<li>We don&#39;t need an addon since we&#39;ve just created it</li>
<li>Environment variables: You have to create 2 of them: ROOT_URL (url of you application) and MONGO_URL (the <code>Connection URI</code> field you saved)</li>
<li>Follow instructions to add the remote repository, <code>git push</code> and it will deploy.</li>
</ul>
<p>Your application should now be deployed, feel free to contact our support if you have any troubles!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Deploy ghost on a PaaS</title>
		<link>https://www.clever.cloud/blog/company/2013/10/16/how-to-deploy-ghost-on-clever-cloud/</link>
		
		<dc:creator><![CDATA[Regis Foucault]]></dc:creator>
		<pubDate>Wed, 16 Oct 2013 00:00:00 +0000</pubDate>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[ghost]]></category>
		<category><![CDATA[Nodejs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2013/10/16/how-to-deploy-ghost-on-clever-cloud/</guid>

					<description><![CDATA[Quick tutorial to deploy Ghost.org instance on Clever Cloud: UPDATE: This article is a little bit old, but some users decided to write a more recent documentation here on how to deploy a Ghost blog on Clever Cloud 1. Retrieve Ghost files In order to download Ghost files, just visit this page : https://en.ghost.org/download/ Extract [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Quick tutorial to deploy <a href="https://ghost.org">Ghost.org</a> instance on Clever Cloud:</p>
<p><strong>UPDATE: This article is a little bit old, but some users decided to write <a href="https://blog.welcomattic.com/blog/2019-04-09-how-to-deploy-ghost-to-clevercloud/">a more recent documentation here on how to deploy a Ghost blog on Clever Cloud</a></strong></p>
<div><img decoding="async" style="max-width: 300px; display: block; margin: 50px auto;" src="https://www2.cleverapps.io/app/uploads/2021/08/ghost-logo.png" alt="ghost logo" /></div>
<p><span id="more-2733"></span></p>
<h3 id="1-retrieve-ghost-files">1. Retrieve Ghost files</h3>
<p>In order to download Ghost files, just visit this page : <a href="https://en.ghost.org/download/">https://en.ghost.org/download/</a></p>
<p>Extract the file and put the folder in your favorite place.</p>
<h3 id="2-open-an-account-on-clever-cloud">2. Open an account on Clever Cloud</h3>
<p>Just visit the <a href="https://api.clever-cloud.com/v2/sessions/login/">signup page</a> and follow the steps.</p>
<h3 id="3-create-an-application">3. Create an application</h3>
<p>Add a Node.js application.</p>
<p>More information available in our documentation : <a href="https://www.clever.cloud/developers/getting-started/quickstart/">http://doc.clever-cloud.com/clever-cloud-overview/add-application/</a></p>
<h3 id="4-create-a-file-system-bucket">4. Create a File System Bucket</h3>
<p>Let&#8217;s store the data!</p>
<p>When you deploy an application, a new instance is created. If you do not persist content files like articles and images, you will lose them between two deployments.</p>
<p>In order to store these files, we have created FS (File System) buckets.</p>
<p>Just add one in the services section.</p>
<p>More information can be found in our documentation : <a href="https://www.clever.cloud/developers/deploy/addon/fs-bucket/">https://doc.clever-cloud.com/databases-and-services/fs-buckets/</a></p>
<p>You will receive the credentials by email. At the root of the application, create a <code>clevercloud/buckets.json</code> file with the following structure:</p>
<pre><code class="language-json">[
  {
    "bucket" : "bucketId",
    "folder" : "/content"
  }
]
</code></pre>
<p>It tells the application to use the files located in the content directory in the FS Bucket.</p>
<p>With the FTP credentials, upload the files located in your local <code>content</code> folder to the remote FTP folder. At the root of the FTP folder, you should have <code>/data</code>, <code>/images</code>, etc. folders.</p>
<h3 id="5-ghost-configuration">5. Ghost Configuration</h3>
<p>You have to tell Ghost how you would like to use it by editing the <code>/config.js</code>.</p>
<p>In both development and production sections:</p>
<ul>
<li>change host to <code>0.0.0.0</code></li>
<li>change port to <code>8080</code></li>
</ul>
<h3 id="6-deploy-the-application">6. Deploy the application</h3>
<p>Last operation, push the local files to the cloud!</p>
<p>Deploy your application on Clever Cloud is very easy. Just type the following commands:</p>
<ul>
<li>init the git repository : <code>git init</code></li>
<li>create a <code>.gitignore</code> file like this:</li>
</ul>
<pre><code class="language-gitignore">node_modules
content
</code></pre>
<ul>
<li>add all files: <code>git add .</code></li>
<li>commit: <code>git commit -m firstcommit</code></li>
<li>push to Clever Cloud: <code>git push &lt;ccremoteurl&gt; master</code></li>
</ul>
<p>You can then check the logs in the left panel logs section.</p>
<h3 id="not-happy-with-sqlite-go-mysql">Not happy with SQLite? Go MySQL</h3>
<p>If you do not want to deal with SQLite storage, you can store your data in MySQL.</p>
<p>To do this, replace the following section:</p>
<pre><code class="language-javascript">database: {
  client: 'sqlite3',
  connection: {
    filename: path.join(__dirname, '/content/data/ghost-test.db')
  }
}
</code></pre>
<p>with:</p>
<pre><code class="language-javascript">database: {
  client: 'mysql',
  connection: {
    host: 'yourhostname',
    user: 'yourusername',
    password: 'yourpassword',
    database: 'yourdbname',
    charset: 'utf8'
  }
}
</code></pre>
<p>You can create a MySQL database on Clever Cloud in <a href="http://doc.clever-cloud.com/databases-and-services/add-service/">5 seconds</a>.</p>
<h3 id="want-to-send-emails">Want to send emails?</h3>
<p>Ghost require external mail providers so that you can send emails. Some of them are <a href="http://www.mailjet.fr">Mailjet</a>, <a href="http://www.mailchimp.com">Mailchimp</a>, <a href="http://www.mailgun.com">Mailgun</a> or <a href="http://gmail.com">Gmail</a>.</p>
<p>The following example allow you to send emails with your Gmail/Google Apps accound from Ghost :</p>
<pre><code class="language-javascript">mail: {
  transport: 'SMTP',
  fromaddress: 'myemail@address.com',
  options: {
    auth: {
      user: 'youremail@gmail.com',
      pass: 'yourpassword'
    }
  }
}
</code></pre>
<p>Feel free to <a href="mailto:support@clever-cloud.com">ask us</a> if you have any questions about this article.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Faster Nodejs applications deployment with Clever Cloud NPM mirror</title>
		<link>https://www.clever.cloud/blog/company/2013/09/12/nodejs-npm-mirror/</link>
		
		<dc:creator><![CDATA[Regis Foucault]]></dc:creator>
		<pubDate>Thu, 12 Sep 2013 00:00:00 +0000</pubDate>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[Nodejs]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2013/09/12/nodejs-npm-mirror/</guid>

					<description><![CDATA[Version française en-dessous Npmjs.org, the Nodejs dependencies repository has recently experienced outages which have blocked every Nodejs application deployment on every server in the world which use this repository including Clever Cloud ones. Actually, when an application is launched locally or on a PaaS like ours, the application has to download all its dependencies. If [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><em><a href="#fr">Version française en-dessous</a></em></p>
<div class="pull-right" style="margin-left: 40px; margin-bottom: 40px; width: 200px;"><img decoding="async" src="https://cdn.clever-cloud.com/uploads/2021/08/npm.png" alt="npm logo" /></div>
<p><a href="http://npmjs.org">Npmjs.org</a>, the Nodejs dependencies repository has recently experienced outages which have blocked every Nodejs application deployment on every server in the world which use this repository including Clever Cloud ones.</p>
<p><span id="more-2731"></span></p>
<p>Actually, when an application is launched locally or on a PaaS like ours, the application has to download all its dependencies. If the repository server is down, the application cannot download the dependencies and the deployment fails.</p>
<p>In order to provide a better deployment experience, we have built our own dependencies mirror so that we do not need to use <a href="http://npmjs.org">npmjs.org</a> servers anymore when deploying applications.<br />
Deployments are now always successful even if <a href="http://npmjs.org">npmjs.org</a> is down. Moreover, instead of downloading dependencies from the US, they are downloaded locally so applications deployments are twice faster.</p>
<p>A very good reason to <a href="https://api.clever-cloud.com/v2/sessions/signup">deploy</a> a Nodejs application on Clever Cloud!</p>
<p><em>The Clever Cloud team</em></p>
<hr id="fr" />
<p><em>Version française</em></p>
<p><a href="http://npmjs.org">Npmjs.org</a>, le dépôt officiel de dépendances Nodejs a récemment subi des interruptions qui ont bloquées les déploiements sur tous les serveurs du monde qui utilisaient ce dépôt officiel, y compris ceux de Clever Cloud.</p>
<p>En effet, lorsqu’une application est lancée localement ou bien sur un PaaS comme le notre, l’application doit télécharger ses dépendances sur des serveurs distants. Si le serveur contenant les dépôts de ces dépendances n’est pas disponible, l’application ne peut pas les récupérer et le déploiement échoue.</p>
<p>Dans le but d’améliorer le déploiement des applications Nodejs, nous avons créé notre propre mirroir de dépendances afin de ne plus avoir à utiliser de nouveau les serveurs <a href="http://npmjs.org">npmjs.org</a> lors de nos déploiements. Ces derniers ne sont donc plus tributaires des interruptions de <a href="http://npmjs.org">npmjs.org</a>. De plus, puisque les dépôts sont téléchargés de nos serveurs et non plus des Etats-Unis, les déploiements sont deux fois plus rapides.</p>
<p>Une bonne occasion donc de <a href="https://api.clever-cloud.com/v2/sessions/signup">déployer</a> dès à présent votre application Nodejs sur Clever Cloud !</p>
<p><em>L&#8217;équipe Clever Cloud</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>What about WebSocket on the Cloud?</title>
		<link>https://www.clever.cloud/blog/features/2013/03/11/what-about-websockets-on-the-cloud/</link>
		
		<dc:creator><![CDATA[Clément Nivolle]]></dc:creator>
		<pubDate>Mon, 11 Mar 2013 00:00:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Nodejs]]></category>
		<category><![CDATA[Websockets]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2013/03/11/what-about-websockets-on-the-cloud/</guid>

					<description><![CDATA[Many users ask us if WebSocket is supported on Clever Cloud. Of course it is! WebSocket works like a charm with PlayFramework 2 and Node.js apps deployed on Clever Cloud. You can check a small demo we have uploaded right here: nodejs-demo.cleverapps.io (be sure to have a mate visiting this link at the same time) [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class="pull-right"></div>
<p>Many users ask us if WebSocket is supported on Clever Cloud. Of course it is! WebSocket works like a charm with PlayFramework 2 and Node.js apps deployed on Clever Cloud.</p>
<p><span id="more-2839"></span></p>
<p>You can check a small demo we have uploaded right here:<br />
<a href="http://nodejs-demo.cleverapps.io">nodejs-demo.cleverapps.io</a> (be sure to have a mate visiting this link at the same time)</p>
<p>If you want to try some experiments on Clever Cloud, here are some ressources with WebSocket use cases:</p>
<ul>
<li><a href="http://socket.io">socket.io</a>: A powerful JS framework to enable WebSocket in your projects.</li>
<li><a href="https://github.com/gre/playpainter">Real-time Paint-like with Play</a>: A great tutorial to check Play&#8217;s real time abilities.</li>
<li><a href="http://www.codeschool.com/courses/real-time-web-with-nodejs">Learn real time with node.js</a> If you&#8217;re new to node.js, CodeSchool may help you.</li>
</ul>
<p>Have fun <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
