Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mkhizeryounas/nanofunction

Microservice framework for nodejs
https://github.com/mkhizeryounas/nanofunction

Last synced: 11 days ago
JSON representation

Microservice framework for nodejs

Awesome Lists containing this project

README

        

# NanoFunction

## Introduction

> Asynchronous HTTP microservices using function based architecture.

## Code Samples

Create an index.js file and export a function that accepts the standard http.IncomingMessage and http.ServerResponse objects:

```
module.exports = (req, res) => {
res.json({
data: {
handle: "@mkhizeryounas"
}
});
};
```

## Installation

```
npm install nanofunction --save
```

Next, ensure that the main property inside package.json points to your microservice (which is inside index.js in this example case) and add a start script:

```
{
"main": "index.js",
"scripts": {
"start": "nanofunction index.js"
}
}
```