How to initialize a nodejs project

To initialize a nodejs project:

  1. run npm init, filled info, we will get a package.json file.
  2. 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.io
    • npm install --save-dev nodemon
      to make nodemon run our node server, modify scripts in package.json file and add an attribute start : "start": "nodemon index.js"
  3. write index.js file

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-07 20:40:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-07 20:40:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-07 20:40:01       82 阅读
  4. Python语言-面向对象

    2024-01-07 20:40:01       91 阅读

热门阅读

  1. Springboot整合Flowable Modeler(flowable6.4.0)

    2024-01-07 20:40:01       53 阅读
  2. Kotlin 作用域函数

    2024-01-07 20:40:01       67 阅读
  3. js三个声明变量说明以及区别

    2024-01-07 20:40:01       59 阅读
  4. flink1.18.0 flink维表join新思路

    2024-01-07 20:40:01       66 阅读
  5. 【Github】上传代码

    2024-01-07 20:40:01       66 阅读
  6. redis

    redis

    2024-01-07 20:40:01      70 阅读
  7. 【题解】leetcode---69. x 的平方(二分查找入门)

    2024-01-07 20:40:01       58 阅读