How to rotate an angled application with node express

1

How do I link a login application developed in angular with node and express server. How do I test (pull) the application to the server.

The server is running normally on port 3000:

var express = require('express');
var bodyParser = require('body-parser');
var port = '3000';

var app = express();

app.listen(port);

app.get('/login.html', function(req, res){
    var pessoa = {
        nome:'Leandro', 
        país:'Brasil',
        cpf:'457898'
    };
    res.json(pessoa);
});
    
asked by anonymous 15.08.2017 / 16:34

1 answer

0

I usually pull like this

  

server.js

     
    

Project folder

         
      

index.html

    
  
var express = require('express');
var bodyParser = require('body-parser');
var app = express();

app.use(express.static(__dirname + '/pastaDoProjeto'));
app.use(bodyParser());

var porta = 3412;

app.listen(process.env.PORT || porta, function(){
    console.log('Servidor online porta ' + porta);
});
    
15.08.2017 / 16:45