<?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>react Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/react/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/react/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Fri, 06 Dec 2024 09:44:45 +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>react Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/react/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Les IA s&#8217;entraînent offshore pour générer des malwares à destination des sangliers</title>
		<link>https://www.clever.cloud/podcast/les-ia-sentrainent-offshore-pour-generer-des-malwares-a-destination-des-sangliers/</link>
					<comments>https://www.clever.cloud/podcast/les-ia-sentrainent-offshore-pour-generer-des-malwares-a-destination-des-sangliers/#respond</comments>
		
		<dc:creator><![CDATA[Jean-Baptiste Kaiser]]></dc:creator>
		<pubDate>Fri, 10 Nov 2023 15:01:50 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ChatGPT]]></category>
		<category><![CDATA[generative ai]]></category>
		<category><![CDATA[IA]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[react]]></category>
		<category><![CDATA[WebGPU]]></category>
		<guid isPermaLink="false">https://www.clever-cloud.com/?post_type=podcast&#038;p=11126</guid>

					<description><![CDATA[<p><img width="1920" height="1080" src="https://cdn.clever-cloud.com/uploads/2023/11/95.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="95" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2023/11/95.jpg 1920w, https://cdn.clever-cloud.com/uploads/2023/11/95-300x169.jpg 300w, https://cdn.clever-cloud.com/uploads/2023/11/95-1024x576.jpg 1024w, https://cdn.clever-cloud.com/uploads/2023/11/95-768x432.jpg 768w, https://cdn.clever-cloud.com/uploads/2023/11/95-1536x864.jpg 1536w, https://cdn.clever-cloud.com/uploads/2023/11/95-1368x770.jpg 1368w" sizes="(max-width: 1920px) 100vw, 1920px" /></p><!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://youtu.be/97YFVapFnKw">Voir sur Youtube</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:paragraph -->
<p>Animé par Jean-Baptiste KAISER  - @ArendSyl<br>avec la participation de : <br>- Guillaume ASSIER : @GuillaumeAssier<br>- Eloi DEMOLIS :  @Wonshtrum<br>- Sylvain WALLEZ : @bluxte </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Épisode enregistré le 7 novembre 2023 </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>👋  Venez discuter avec nous sur <a href="https://twitter.com/clever_cloudFR" target="_blank" rel="noreferrer noopener">@clever_cloudFR</a> pour nous dire ce que vous avez pensé de ce nouvel épisode.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>➡️  Pour découvrir ou réécouter d’anciens épisodes&nbsp;<a href="https://www.clever.cloud/fr/podcast/">c’est par ici</a>&nbsp;!</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Chapitrage et liens</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>00:01:24 Executive Order sur l’IA <a href="https://bsky.app/profile/dashishka.bsky.social/post/3kd25ppdlek2l">https://bsky.app/profile/dashishka.bsky.social/post/3kd25ppdlek2l</a><br><a href="https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/">https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:07:03 Platforme d’entrainement d’IA en pleine mer <a href="https://www.numerama.com/tech/1547042-pour-echapper-aux-regulations-sur-lia-une-entreprise-veut-creer-un-etat-en-pleine-mer.html">https://www.numerama.com/tech/1547042-pour-echapper-aux-regulations-sur-lia-une-entreprise-veut-creer-un-etat-en-pleine-mer.html</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:12:01 Adoption de WebGPU (and “Rust is the defacto standard for graphics in Rust”) <a href="https://www.youtube.com/watch?v=CklvTsKogTg">https://www.youtube.com/watch?v=CklvTsKogTg</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:22:15 Alternant chez Orange le jour, dev de malwares la nuit<br><a href="https://www.zdnet.fr/actualites/alternant-chez-orange-cyberdefense-le-jour-developpeur-de-programmes-malveillants-la-nuit-39962084.htm">https://www.zdnet.fr/actualites/alternant-chez-orange-cyberdefense-le-jour-developpeur-de-programmes-malveillants-la-nuit-39962084.htm</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:28:43 React serveur<br><a href="https://twitter.com/manekinekko/status/1717957681359495449">https://twitter.com/manekinekko/status/1717957681359495449</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:36:27 ChatGPT Builder<br><a href="https://openai.com/blog/introducing-gpts
">https://openai.com/blog/introducing-gpts<br></a><a href="https://twitter.com/heyBarsee/status/1721792544814588141">https://twitter.com/heyBarsee/status/1721792544814588141</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:46:50 Text to 3D generative AI<br><a href="https://research.nvidia.com/labs/dir/magic3d/">https://research.nvidia.com/labs/dir/magic3d/</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:51:28 #sanglicam<br><a href="https://twitter.com/hashtag/sanglicam?f=live">https://twitter.com/hashtag/sanglicam?f=live</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:56:42 Musique de fin<br>Eloi (6-10) : OOGIE BOOGIE'S SONG | The Nightmare Before Christmas | VoicePlay A Cappella Cover  : <a href="https://www.youtube.com/watch?v=EbxkOntz2SA">https://www.youtube.com/watch?v=EbxkOntz2SA</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->]]></description>
										<content:encoded><![CDATA[<p><img width="1920" height="1080" src="https://cdn.clever-cloud.com/uploads/2023/11/95.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="95" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2023/11/95.jpg 1920w, https://cdn.clever-cloud.com/uploads/2023/11/95-300x169.jpg 300w, https://cdn.clever-cloud.com/uploads/2023/11/95-1024x576.jpg 1024w, https://cdn.clever-cloud.com/uploads/2023/11/95-768x432.jpg 768w, https://cdn.clever-cloud.com/uploads/2023/11/95-1536x864.jpg 1536w, https://cdn.clever-cloud.com/uploads/2023/11/95-1368x770.jpg 1368w" sizes="(max-width: 1920px) 100vw, 1920px" /></p><!-- wp:buttons -->
<div class="wp-block-buttons"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link wp-element-button" href="https://youtu.be/97YFVapFnKw">Voir sur Youtube</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:paragraph -->
<p>Animé par Jean-Baptiste KAISER  - @ArendSyl<br>avec la participation de : <br>- Guillaume ASSIER : @GuillaumeAssier<br>- Eloi DEMOLIS :  @Wonshtrum<br>- Sylvain WALLEZ : @bluxte </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Épisode enregistré le 7 novembre 2023 </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>👋  Venez discuter avec nous sur <a href="https://twitter.com/clever_cloudFR" target="_blank" rel="noreferrer noopener">@clever_cloudFR</a> pour nous dire ce que vous avez pensé de ce nouvel épisode.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>➡️  Pour découvrir ou réécouter d’anciens épisodes&nbsp;<a href="https://www.clever.cloud/fr/podcast/">c’est par ici</a>&nbsp;!</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Chapitrage et liens</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>00:01:24 Executive Order sur l’IA <a href="https://bsky.app/profile/dashishka.bsky.social/post/3kd25ppdlek2l">https://bsky.app/profile/dashishka.bsky.social/post/3kd25ppdlek2l</a><br><a href="https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/">https://www.whitehouse.gov/briefing-room/presidential-actions/2023/10/30/executive-order-on-the-safe-secure-and-trustworthy-development-and-use-of-artificial-intelligence/</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:07:03 Platforme d’entrainement d’IA en pleine mer <a href="https://www.numerama.com/tech/1547042-pour-echapper-aux-regulations-sur-lia-une-entreprise-veut-creer-un-etat-en-pleine-mer.html">https://www.numerama.com/tech/1547042-pour-echapper-aux-regulations-sur-lia-une-entreprise-veut-creer-un-etat-en-pleine-mer.html</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:12:01 Adoption de WebGPU (and “Rust is the defacto standard for graphics in Rust”) <a href="https://www.youtube.com/watch?v=CklvTsKogTg">https://www.youtube.com/watch?v=CklvTsKogTg</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:22:15 Alternant chez Orange le jour, dev de malwares la nuit<br><a href="https://www.zdnet.fr/actualites/alternant-chez-orange-cyberdefense-le-jour-developpeur-de-programmes-malveillants-la-nuit-39962084.htm">https://www.zdnet.fr/actualites/alternant-chez-orange-cyberdefense-le-jour-developpeur-de-programmes-malveillants-la-nuit-39962084.htm</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:28:43 React serveur<br><a href="https://twitter.com/manekinekko/status/1717957681359495449">https://twitter.com/manekinekko/status/1717957681359495449</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:36:27 ChatGPT Builder<br><a href="https://openai.com/blog/introducing-gpts
">https://openai.com/blog/introducing-gpts<br></a><a href="https://twitter.com/heyBarsee/status/1721792544814588141">https://twitter.com/heyBarsee/status/1721792544814588141</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:46:50 Text to 3D generative AI<br><a href="https://research.nvidia.com/labs/dir/magic3d/">https://research.nvidia.com/labs/dir/magic3d/</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:51:28 #sanglicam<br><a href="https://twitter.com/hashtag/sanglicam?f=live">https://twitter.com/hashtag/sanglicam?f=live</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>00:56:42 Musique de fin<br>Eloi (6-10) : OOGIE BOOGIE'S SONG | The Nightmare Before Christmas | VoicePlay A Cappella Cover  : <a href="https://www.youtube.com/watch?v=EbxkOntz2SA">https://www.youtube.com/watch?v=EbxkOntz2SA</a></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->]]></content:encoded>
					
					<wfw:commentRss>https://www.clever.cloud/podcast/les-ia-sentrainent-offshore-pour-generer-des-malwares-a-destination-des-sangliers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</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>
	</channel>
</rss>
