Answer the question
In order to leave comments, you need to log in
How to use the server language in a document?
const localConfig = require('./localConfig.js');
const express = require("express");
const http = require('http');
const https = require('https');
const fs = require('fs');
const app = express();
const httpServer = http.createServer(app);
const httpsServer = https.createServer(app);
httpServer.listen(8080,function(){
console.log('HTTP Server running on port 8080');
});
httpsServer.listen(443,function(){
console.log('HTTPS Server running on port 443');
});
app.get('/',function(req,res){
res.status(200);
res.setHeader('Content-Type','text/html');
res.sendfile('index.php');
//res.send('Hello');
});
app.post('/',function(req,res){
res.status(200);
res.setHeader('Content-Type','text/html');
res.send('Hello');
});
app.get('*',function(req,res){
res.status(404);
res.setHeader('Content-Type','text/plain');
res.send('Not found');
});
app.post('*',function(req,res){
res.status(404);
res.setHeader('Content-Type','text/plain');
res.send('Not found');
});
Какой то текст.
<?
if(isset($_GET['test'])){
echo 'Строка из php';
}
?>
Какой то текст.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question