Skip to content

A Javascript/React template, for quick development setup in Crafting Sandbox.

License

Notifications You must be signed in to change notification settings

crafting-dev/template-javascript-react

Repository files navigation

Javascript/React template for Crafting Sandbox

This is a Javascript/React template, configured for quick development setup in Crafting Sandbox.

Specifications

This template contains a single Ping component:

<React.StrictMode>
  <Ping />
</React.StrictMode>

This component consists of a form with a single input and a button.

Once form is submitted, a GET request is made to some backend server that exposes a /ping api. This Ping component then renders the api response data.

<code>
  {JSON.stringify(
    {
      ping: pong.ping,
      received_at: new Date(pong.received_at).toLocaleString(),
    },
    null,
    2
  )}
</code>

To run the app, you can do:

PORT=3001 npm start

App Definition

The following App Definition was used to create this template:

endpoints:
- name: app
  http:
    routes:
    - pathPrefix: "/"
      backend:
        target: js-react
        port: app
    authProxy:
      disabled: true
workspaces:
- name: js-react
  description: Template frontend using Js/React
  ports:
  - name: app
    port: 3001
    protocol: HTTP/TCP
  checkouts:
  - path: frontend
    repo:
      git: https://github.com/crafting-dev/template-javascript-react
  packages:
  - name: nodejs
    version: 16.12.0

About

A Javascript/React template, for quick development setup in Crafting Sandbox.

Resources

License

Stars

Watchers

Forks