简体   繁体   中英

Can i run a php file or a html file in a node js web server?

也许这是一个愚蠢的问题,但是我是使用节点js的新手,我认为它只能与js文件一起使用,我不知道,我在Windows上安装了节点js,然后启动了Web服务器,但我不知道如何运行文件,我一直使用apache,我看到node js安装文件夹中有一个名为scrips的文件夹

but i dont know how to run the files, I have always worked with apache.

In NodeJS, it's either you write the web server (it's like writing Apache itself), or use a framework that does it for you (it's like adding in something like Apache). Suggesting you check out Express . It's something almost close to CodeIgniter (writing points of entry).

Can i run a php file or a html file in a node js web server?

NodeJS is for JS. Your server files are all in JS. As for HTML, checkout Express (mentioned above), or if you just want to serve plain HTML (or static files), you may want to check out Connect Static

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM