O
O
Oleg Ostashov2018-04-04 01:53:29
Node.js
Oleg Ostashov, 2018-04-04 01:53:29

How to deploy a Node.js application to Azure?

Hey!
There is a desire to deploy a node.js (with mongoDB) project from github to microsoft azure. I set up continuous deployment, but there was one question left. In the project, I have a config.js file, which I do not push to github, because there are login and password for connecting to the database. Hence, nothing is working yet.
How can I manually load this config.js file into the project root in azure?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ihor Gevorkyan, 2018-04-04
@olegostashov

I don’t know about the specifics of working with azure, but usually, according to the flow:
1. The repo contains config.sample.js with test (not real credentials)
2. The service that takes the sources from the repository and builds on the server must be able to run custom scripts (probably shell scripts), inside the script it is written that:
- the file (before starting the build process (some kind of pre-build, probably)) is renamed to config.js
- reading the file from the script, replacing the test credentials with real ones, using regular expression search - the service makes a
build, already with a ready-made configuration file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question