Skip to content

maon-fp/node18-express-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Get your hands dirty

$ faas template pull https://github.com/maon-fp/node18-express-microservice
$ faas new --lang node18-express-microservice

Basic example

import { Router } from "express";

export default ({ app }) => {
  const router = Router();

  router.post("/", (request, response) => {
    return response.json({ message: "Hello world!", body: request.body });
  });

  return router;
};

Basic example with one external package that prints the time

yarn add moment
import { Router } from "express";
import moment from "moment";

export default ({ app }) => {
  const router = Router();

  router.get("/", (request, response) => {
    return response.json({ time: moment() });
  });

  return router;
};

About

OpenFaas template

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published