How to output Node. js?

Source: Internet
Author: User
Does node. js directly output content without the support of similar servers such as apache? Now that apache + php is available, you want to use nodejs to output content on the server, such as calling a javascript render method, output markdown text to html on the server... node. does js directly output content without support from similar servers such as apache?

Now that apache + php is available, you want to use nodejs to output content on the server, such as calling a javascript render method and outputting markdown text to html on the server side, what should I do?

Reply content:

Does node. js directly output content without the support of similar servers such as apache?

Now that apache + php is available, you want to use nodejs to output content on the server, such as calling a javascript render method and outputting markdown text to html on the server side, what should I do?

If you don't want to change the existing architecture, you still feel better using PHP or using javascript on the client.

It means node. javaScript does not need to help apache provide web services like php. This is correct, node. js has built-in http service, so it is easy to build a website.
I guess your need should be like this. To create a website, there is already a markdown file, which should be converted into html format for display to users.
You can do this: build a website with express, then convert and provide services with the markdown (https://github.com/evilstreak/markdown-js) plug-in.

I'm not quite clear about what you mean. Let's talk about my opinion:

  • If you want to output md to an html page.

There are many ways to do this. php and nodejs can do this. Many open-source libraries in nodejs do this and do not need any cooperation from php.

  • If you want to output md to the html page through nodejs, then use apache to display it.

Without saying whether the solution is reasonable, the key point is the interaction between php and nodejs. You can use nodejs to create a server. The function is to convert md to html, provide such an http interface, and then use php to call the background to return to the foreground, or call the foreground, however, there may be cross-origin issues.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.