0

I would like to send a PHP file with NodeJS instead of HTML file, This is my script:

app.use(express.static(path.join(__dirname, 'public')));
app.get('/', function(req, res) {
   res.sendFile(path.join(__dirname + '/serv.html'));
})   

It doesn't works when I replace 'serv.html' with 'serv.php'...

Thank you very much

4
  • Why would you need that ? Commented Oct 31, 2018 at 15:11
  • Because I need my clients to use PHP. Commented Oct 31, 2018 at 15:11
  • Maybe it could help you ... stackoverflow.com/questions/43824678/… Commented Oct 31, 2018 at 15:41
  • It doesn't works for me Commented Oct 31, 2018 at 19:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.