Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zeit/micro-dev
The development environment for `micro`
https://github.com/zeit/micro-dev
cli command-line development interface tools
Last synced: 2 months ago
JSON representation
The development environment for `micro`
- Host: GitHub
- URL: https://github.com/zeit/micro-dev
- Owner: vercel
- License: mit
- Created: 2017-07-21T10:01:13.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-06-08T20:31:08.000Z (5 months ago)
- Last Synced: 2024-08-27T19:53:23.635Z (2 months ago)
- Topics: cli, command-line, development, interface, tools
- Language: JavaScript
- Homepage:
- Size: 360 KB
- Stars: 702
- Watchers: 60
- Forks: 76
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micro - micro-dev - The development environment for `micro`. (Development Tools / Utilities)
README
# Micro (Dev) — Asynchronous HTTP microservices
This command line interface provides a belt full of tools that make building microservices using [micro](https://github.com/vercel/micro) a breeze! It's only meant to be used in development, **not in production** (that's where [micro](https://github.com/vercel/micro) comes in).
## 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](https://github.com/vercel/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`:
```bash
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`:
```json
"scripts": {
"start": "micro",
"dev": "micro-dev"
}
```As the final step, start the development server like this:
```bash
npm run dev
```## Debugging
The package can be used in conjunction with the Node.js inspector like this:
```json
"scripts": {
"inspect": "node --inspect node_modules/.bin/micro-dev"
}
```As the final step, start the development server like this:
```bash
npm run inspect
```## Contributing
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) 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
- Leo Lamprecht ([@leo](https://x.com/leo))
- Tim Neutkens ([@timneutkens](https://x.com/timneutkens)) - [Vercel](https://vercel.com)