Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

jeblister/micro-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micro-rest API & async + await

Minimal project for building REST APIs with Zeit's Micro and async + await.

Installation

npm install micro micro-api

Compile with babel

To optimize startup time we will pre-compile code before you ship. For that, you can define a task like this:

"scripts": {
  "build": "babel lib --out-dir dist"
}

If you plan to start or publish, make sure that you only serve from dist directory after babel comilation:

"scripts": {
        "start": "micro -p 3000 dist/",
        "prestart": "npm run build",
        "build": "babel lib --out-dir dist",
        "prepublish": "npm run build"
    },

Run

Finally, micro gives you a little binary to launch the exported microservice easily:

"scripts": {  
  // …
  "start": "micro -p 3000 dist/"
}

Reference

Minimum Viable Async with Node 6

About

Minimal project for building REST APIs with Zeit's [Micro](https://github.com/zeit/micro) and async + await.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published