micro-dev

The development environment for `micro`

Github星跟蹤圖

This command line interface provides a belt full of tools that make building microservices using micro a breeze! It's only meant to be used in development, not in production (that's where micro comes in).

CircleCI
Join the community on Spectrum

Features

  • Hot Reloading: When making changes to your code, the server will restart by itself
  • Logs: Incoming and outgoing requests will be logged to stdout
  • Beautiful JSON: When JSON bodies are logged, they're styled and prettified
  • Clipboard Support: The local address is pasted to the clipboard automatically
  • Port Selection: Automatic detection and use of an open port (if the specified one is in use)
  • Debug in Your Network: The network address shown in addition to local one
  • Duration Logs: Calculates and shows the duration for each request
  • Pretty Errors: Prettifies the Error object if any exceptions are thrown

Usage

Important: This tool is only meant to be used in development. In production, you should use micro, which is much lighter and faster (and also comes without the belt of tools used when developing microservices).

When preparing your development environment, firstly install micro-dev:

npm install --save-dev micro-dev

Note: You'll need at least Node.js v7.6.0 to run micro-dev.

Next, add a new script property below micro inside package.json:

"scripts": {
  "start": "micro",
  "dev": "micro-dev"
}

As the final step, start the development server like this:

npm run dev

Debugging

The package can be used in conjunction with the Node.js inspector like this:

"scripts": {
  "inspect": "node --inspect node_modules/.bin/micro-dev"
}

As the final step, start the development server like this:

npm run inspect

Contributing

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Move into the directory of the clone: cd micro-dev
  3. Link it to the global module directory of Node.js: npm link

Inside the project where you want to test your clone of the package, you can now either use npm link micro-dev to link the cloned source to your project's local dependencies or run micro-dev right in your terminal.

Authors

主要指標

概覽
名稱與所有者gragland/usehooks
主編程語言JavaScript
編程語言JavaScript (語言數: 2)
平台
許可證The Unlicense
所有者活动
創建於2021-03-02 21:39:47
推送於2021-11-21 01:04:53
最后一次提交2021-03-01 21:13:56
發布數0
用户参与
星數397
關注者數9
派生數50
提交數162
已啟用問題?
問題數0
打開的問題數0
拉請求數0
打開的拉請求數4
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?