How to initialize a nodejs project
2024-01-07 17:23:38
To initialize a nodejs project:
- run
npm init
, filled info, we will get apackage.json
file. - install some npm dependencied to make this nodejs server work, for example:
npm install express cors axios
express is a HTTP framework for running node servers.
cors make us be able to call this server from anywhere else on the internet.
axios make us be able to make API calls to chat engine.ionpm install --save-dev nodemon
to makenodemon
run our node server, modifyscripts
inpackage.json
file and add an attributestart
:"start": "nodemon index.js"
- write
index.js
file
文章来源:https://blog.csdn.net/weixin_43561635/article/details/135425521
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。 如若内容造成侵权/违法违规/事实不符,请联系我的编程经验分享网邮箱:veading@qq.com进行投诉反馈,一经查实,立即删除!