npm start如何在端口8000上运行服务器 [英] How npm start runs a server on port 8000

查看:245
本文介绍了npm start如何在端口8000上运行服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近使用github上的angular-seed文件夹进行了角度应用程序开发.在以前的一些angularjs教程中,angular-seed文件夹中有一个脚本文件夹和一个server.js文件,它们具有用于运行节点服务器的所有配置.那么npm现在如何开始运行节点服务器,该节点服务器的所有配置在哪里?

I recently used a angular-seed folder from github for angular application development. In some previous angularjs tutorial there was a script folder and a server.js file in the angular-seed folder which had all the configuration for running the node server. So how does npm now just start running a node server and where is all the configuration of that node server?

推荐答案

如果您要查看package.json文件.

您将看到类似的内容

 "start": "http-server -a localhost -p 8000"

这告诉在端口8000上的localhost地址处启动http-server

This tells start a http-server at address of localhost on port 8000

http服务器是节点模块.

更新:-包括@Usman的评论,理想情况下,它应该出现在您的package.json中,但是如果不存在,则可以将其包括在scripts部分中.

Update:- Including comment by @Usman, ideally it should be present in your package.json but if it's not present you can include it in scripts section.

这篇关于npm start如何在端口8000上运行服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆