An example of using the date-fns dependency within a node environment running an Express API server.
1.) Clone repo: git clone git@github.com:mattcarlotta/date-fns-node.git
2.) Install deps: cd date-fns-node && yarn
3.) Run dev: yarn dev
4.) See below to query API.
yarn <command> |
Description |
---|---|
build |
Compiles source to build for production. |
dev |
Starts development servers (localhost:4000 for api). |
lint |
Lints all .ts files in root directory. |
start |
Starts production server (must run build first). |
tsc |
Type checks all .ts files within the root directory. |
Get current date:
http://localhost:4000/api/date
Get a formatted date:
http://localhost:4000/api/date/2019-02-10T02:30:31.834+00:00