node.js - ExpressJS - Using local files in development and files from Azure Blob Storage in production -
I am planning to recreate an application on the expressway, which has static assets which are obtained from blue block storage Are done. What is the easiest way to switch references in my Jade files and SASS, when locally / evolution, expresses to local assets, and when pushed into production, then it looks blue to the assets?
I would use Gulp for my build process, so whether it would be better to apply it as a build, or in the form of a method directly in the application?
I consider both environments (prod and test / development) both Linux for the purpose of this answer .
In an environment that runs your express services, you can execute below, which will allow you to understand which environment it is running. This will save the situation in reboot. Change whatever environment is running on "machine" (development / production / testing / etc).
$ echo Export NODE_ENV = Production & gt; & Gt; ~ \ .bash_profile $ source ~ / .bash_profile Now, in your app js file, you may be able to configure your app references by modifying the snippet below:
app.configure ('development', function () {// set an application variable to use local resources}); App.configure ('output', function) (// set an application variable to use Azure Blob storage)};
Comments
Post a Comment