Giter Site home page Giter Site logo

new-af / timestamp-microservice Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 119 KB

API and React App to convert between timestamp and UTC string representations (will take 30 seconds to spin up the inactive server)

Home Page: https://timestamp-microservice-t7m9.onrender.com/

JavaScript 70.90% HTML 2.52% CSS 26.59%
api express microservice react redux-toolkit timestamp-microservice timestamps

timestamp-microservice's Introduction

Express.js Badge React Badge Redux Toolkit Badge Node.js Badge JavaScript Badge CSS3 Badge Vite Badge Render Badge

Timestamp microservice

An API and GUI React App for it to convert date time between javascript

  • milliseconds timestamps and
  • UTC date time string representation of it

Example:

  • timestamp 1451001600000 and
  • date time string Fri, 25 Dec 2015 00:00:00 GMT

API Usage

call response response JSON format
/ run the React App (HTML) not returned
/api/ get the JSON of current time {"unix":1690638937740,"utc":"Sat, 29 Jul 2023 13:55:37 GMT"}
/api/1451001600000 get the Successful JSON of converted timestamp {"unix":1451001600000,"utc":"Fri, 25 Dec 2015 00:00:00 GMT"}
/api/Fri, 25 Dec 2015 00:00:00 GMT get the Successful JSON of converted date time string {"unix":1451001600000,"utc":"Fri, 25 Dec 2015 00:00:00 GMT"}
/api/invalid-date get the Error JSON {"error":"Invalid Date"}

Run the App Online

https://timestamp-microservice-t7m9.onrender.com/ (Will take 30 seconds to spin up the inactive server)

Build and Run App Locally

Pre-dependencies

Program Download link Note
Node.js https://nodejs.org/en/download Also installs npm package manager
Git https://git-scm.com/downloads
(Optional) pnpm https://pnpm.io/installation This is a different package manager used for reduced disk space when installing below packages.
This is optional, the builtin npm will work too with below commands,
Just replace pnpm with npm

Dependencies

Step Terminal commands Notes
clone the repository or download it as ZIP file git clone https://github.com/new-AF/timestamp-microservice.git
enter the directory of the now local repository cd timestamp-microservice
install the dependencies pnpm install
Run the backend server pnpm exec server/server.js
  • For npm run
    npx nodemon server/server.js

  • most API calls like will work except the root paththese will not run the React App because they look for the index.html in the missing directory dist that is created and updated by running pnpm run build each time you edit the React App to run the most recent version.
  • To avoid running the build command each time, access the React App from the frontend server below.
Run the frontend server and the React App pnpm run dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.