Coder Social home page Coder Social logo

frigadehq / frigade-react-nextjs-demo Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 5.0 158 KB

A demo app that shows how to use Frigade with React + Next.js

Home Page: https://frigade-react-nextjs-demo.vercel.app

License: MIT License

JavaScript 4.30% TypeScript 95.44% CSS 0.27%

frigade-react-nextjs-demo's Introduction

Frigade React + Next.js Example

This is a simple example of how to use Frigade with React and Next.js.

Getting Started

Install dependencies:

yarn

Then run the local development server (make sure to trust the local certificate for https):

yarn dev

frigade-react-nextjs-demo's People

Contributors

brownrout avatar christianmat avatar dfltr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

frigade-react-nextjs-demo's Issues

Request to include config.yaml in git repo

Hi there,

I am just learning about Frigade and am trying to understand how the frontend interacts with the service. It could be helpful to include the config.yaml in the git repo so that developers can reference it when understanding the flows.

Thanks

Incompatible script command for opening the browser.

The current script command: "open-browser": "open https://localhost:5678" is not a standard command on Windows or Linux.

Screenshot 2023-07-29 011226

I believe it's necessary to make sure the script command is compatible across different OS so that developers can have a smooth experience and focus on solving problems.

I came up with two solutions
. One is to make it a single line command like this: "open-browser": "node -e \"const { execFile } = require('child_process'); /^win/.test(process.platform) ? execFile('cmd', ['/c', 'start', 'https://localhost:5678']) : execFile('xdg-open', ['https://localhost:5678'])\"", which makes it harder to read.

Another solution would be to add a function like this in server.js:

const { execFile } = require('child_process');

function openBrowser(url) { if (/^win/.test(process.platform)) { execFile('cmd', ['/c', 'start', url]); } else { execFile('xdg-open', [url]); } }

openBrowser('https://localhost:5678');,

and then just run the script like this: "dev": "yarn node server.js", which makes it more maintainable and readable.

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.