This is a simple example of how to use Frigade with React and Next.js.
Install dependencies:
yarn
Then run the local development server (make sure to trust the local certificate for https):
yarn dev
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
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
The current script command: "open-browser": "open https://localhost:5678"
is not a standard command on Windows or Linux.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.