Create free hello world REST API with @microfunctions/cli

Description

The Microfunctions CLI is a command-line interface tool that helps you to initialize, develop, and maintain your Microfunctions serverless

Installation

npm install -g @microfunctions/cli

Scaffolds a new function

$ microfunctions new helloword⚡  We will scaffold your app in a few seconds..? login to MicroFunctions.io to generate your  cliKey :  xxxxxx-xxxx-xxxx-xxxx-9eb5b3e7d41f? What Namespace would you like 😻  to use? hellwordnamespace? What ExecutedName would you like to use ? helloword? Which Memory would you 😻  to use? 32? Which Replicas would you 🍺  to use? 1? Which Runtime would you 😽  to use? nodejs12? Which package manager would you ❤️  to use? yarnCREATE helloword/.babelrc (48 bytes)CREATE helloword/.env (0 bytes)CREATE helloword/README.md (231 bytes)CREATE helloword/microfunctions-cli.json (46 bytes)CREATE helloword/package.json (776 bytes)CREATE helloword/server.js (1381 bytes)CREATE helloword/src/index.js (76 bytes)                                      

🚀 Successfully created project helloword

✔ Installation in progress… ☕

🚀 Successfully created project helloword

👉 Get started with the following commands:

$ cd helloword

$ yarn run startyarn run v1.22.0warning ../../package.json: No license field$ nodemon ./server.js  --exec babel-node -e js[nodemon] 2.0.6[nodemon] to restart at any time, enter `rs`[nodemon] watching path(s): *.*[nodemon] watching extensions: js[nodemon] starting `babel-node ./server.js`your server is running on port 3000.                                              

$curl — request GET ‘http://localhost:3000'

helloword

Deploy microfunctions

$ microfunctions deploy
⚡ We will scaffold your app in a few seconds..
UPDATE package.json (812 bytes)url : https://endpoint.microfunctions.io/api/hellwordnamespace00gepewpfr/hellword 🍺

curl — location — request GET ‘https://endpoint.microfunctions.io/api/hellwordnamespace00gepewpfr/hellword' \ — header ‘x-apikey-header: xxxxxxx–xxxx–xxxx–xxxx–7d1232f28770’

helloword

console.microfunctions.io

console.microfunctions.io

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

ben sassi mohammed
ben sassi mohammed

Written by ben sassi mohammed

Architecte API , Microservices , javascript , java , Angular, kubernetes

No responses yet

Write a response