Giter Site home page Giter Site logo

node-anyserver's Introduction

node-anyserver

a static resource server which development by node

安装启动

npm i
npm run start

开发

严格eslint 提交之前必须通过eslint(pre-commit)

npm run lint

调试

  • 1.node --inspect-brk app.js(先打开chrome调试界面,启动命令加-brk送启动开始调试,调试界面打开,正常chrome调试即可)
  • 2.IDE调试 (vs code 调试选项-》设置配置参数启动选项,打断点,结合启动调试)

开发节点

  • 1.框架搭建 github创建仓库添加README.md

  • 2.npm init 创建package.json

  • 3.加入eslint

  • 4.创建初始http 使用supervisor启动服务(supervisor监控代码改动 全局安装) supervisor src/app.js

  • 5.加入路由 并用promisify解决异步回调

  • 6.添加模板ejs

  • 7.定义文件类型 MIME

  • 8.http压缩(compress.js 对比压缩前后看一下)

  • 9.http缓存(根据请求头if-modified-since和if-none-match和响应头last-modified和etag字段对比确定是否重新请求 200/304) (注意点:chrome浏览器刷新都是200是因为浏览器的原因,显示frome dist/memory cache 火狐显示304)

  • 10.实现cli命令行

  • 11.npm包

node-anyserver's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.