将Angular 5项目从节点服务器迁移到Apache

时间:2018-10-31 07:07:48

标签: node.js angular apache

我的项目的UI部分用角度5编码。我已经在服务器和Express服务器中使用节点配置来服务该应用程序。为了更好地理解,我在下面的代码中提供了此代码。

var crypto = require('crypto');
    var http = require('http');
    var cookieParser = require('cookie-parser');
    var path = require('path');
    var bodyParser = require('body-parser');
    var express = require('express');
    var app = express();
    var httpsPort = 4433;
    var https = require('https');
    var fs = require('fs');
    var options = {
       key : fs.readFileSync('encryption/star_massifsolutions_com.key'),
       cert : fs.readFileSync( 'encryption/massif_wildcard.crt' ),
       ca : fs.readFileSync( 'encryption/DigiCertCA.crt' )
    };

    var privateKey = fs.readFileSync('encryption/star_massifsolutions_com.key').toString();
    var certificate = fs.readFileSync('encryption/massif_wildcard.crt').toString();
    var ca = fs.readFileSync('encryption/DigiCertCA.crt').toString();

    var credentials = {key: privateKey, cert: certificate, ca : ca };

    var httpServer = http.createServer(app);
    var httpsServer = https.createServer(credentials, app);

    httpsServer.listen(3004);

    app.set('view',__dirname+'/views');
    app.use(bodyParser.urlencoded({extended:true}));
    app.use(bodyParser.json({limit: '500mb'}));


    app.use('/', express.static(path.join(__dirname,'/dist/basic-structure')));

    app.get('/**', function(req, res, next) {
        console.log(req, res, next);
        res.sendFile('index.html', { root: __dirname + '/dist/basic-structure' });
    });

我的目标是将其迁移到apache托管服务器,即我想用apache替换我的节点配置。如果需要更多信息,我已经给出了关于服务器配置的非常基本的想法。帮助我更换节点。我一次都不想要。我只想用Apache代替节点

0 个答案:

没有答案