Jareechang / common-web-modern-express

example using the pre-configured rollup (babel and typescript) to run express

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@common-web mordern express example

An Example of running an express.js api using with @common-web utils. Leverage latest babel + typescript features in your api.

Tech

Getting Started

  1. Installation
yarn install

  1. Commands (run server static or in watch mode)
// Build src files (index.ts) into dist/index.js
yarn run build

// runs the server 
yarn run run-server

// runs the server in watch mode
yarn run watch-server
  1. Test out API

Request:

curl http://localhost:3000/api/test | jq

Response:

{
  "data": [
    {
      "name": "Bob",
      "age": 32
    },
    {
      "name": "Judy",
      "age": 33
    },
    {
      "name": "Jill",
      "age": 28
    },
    {
      "name": "Sally",
      "age": 22
    }
  ]
}

About

example using the pre-configured rollup (babel and typescript) to run express


Languages

Language:TypeScript 57.8%Language:JavaScript 42.2%