I am a newbie in infrastructure and the question may sounds dumb.. here is the case, I have developed an template of a web application that runs locally - getting data from internet and saving it to local MySQL server then run node.js local host to see the web interface with connection to the database... everything worked fine locally.
Then the next step is to deploy it to the internet. I opened an account at Azure and launched a vm (MS server 2016), the interface was pretty much like a windows 10 PC. then I basically replicated the procedure on the server... then the problem emerged.. like I have been doing all this through remote desktop connection, however, we need to connect to the web application from an external url (like people can type in the url and visit the web app from their smartphone browser or tablet browser)..What should I do to make this happen?
Hope I explained this whole situation clearly... Thanks
Here is the code of the node.js local server
var express = require('express');
var fs = require('fs');
var app = express();
app.use(express.static(__dirname));
function getFiles(){
var files="";
var items=fs.readdirSync("./SDG_summary");
for(var i=0; i<items.length; i++){
if(items[i].indexOf("_summary")!=-1){
if(i==items.length-1){
files+=items[i];
}else{
files+=items[i]+", ";
}
}
}
return files;
}
app.get('/', function(req, res){
res.sendFile(__dirname+ '/index.html');
});
app.get('/files', function(req, res){
var files=getFiles();
res.send(files);
});
app.listen(8081);
Aucun commentaire:
Enregistrer un commentaire