Does IntelliJ have an internal web server to serve static content of a web application?

前端 未结 7 2548
悲&欢浪女
悲&欢浪女 2021-02-19 16:28

Right now, the directory of my module is defined as an IIS virtual directory and IIS serves the files.

I was wondering whether IntelliJ has an internal web server, whic

7条回答
  •  误落风尘
    2021-02-19 17:12

    One simple way is to create a NodeJS / Express project in IntelliJ that is your web server. You can then use it to serve your static web pages and any other web content. The NodeJS web server is very small and runs fast - noticeably faster than IIS and Apache. Best of all you can just hit the Run button in IntelliJ or WebStorm to start it up.

    By default, a NodeJS / Express project includes a public/ directory that you can use to contain your static pages that you can then view from http://localhost:3000/

    This explains the steps required to enable NodeJS in IntelliJ and includes links to other Node resources: http://www.jetbrains.com/idea/webhelp/node-js.html

    If you feel the need, you can reconfigure your NodeJS server using server side Javscript code. You can add SSL support or almost any other server side features you care to dream up. Just add NodeJS modules using the npm (Node Package Manager) command line tool included with the install. NPM Registry https://npmjs.org/ indexes all the available modules.

提交回复
热议问题