用 Rust 编写 ReactJS
Write ReactJS in Rust

原始链接: https://github.com/hyper-forge/brahma-react

这个模板提供了一个最小化的配置,用于在 Vite 中使用 React,并支持热模块替换 (HMR) 和 Brahma-Firelight(一个基于 Rust 的高速服务器,构建于 TOKIO & HYPER 之上)。 npm install npm run build npm run dev 要在开发期间设置 API 代理 (vite.config.ts/js): import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], server: { proxy: { "/api": { target: "http://localhost:2000", // 你的后端端口 (brahma-firelight API) changeOrigin: true, secure: false, }, }, }, }); Brahma-Firelight 超快速的基于 Rust 的 JavaScript 框架 阅读文档

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 用 Rust 编写 ReactJS (github.com/hyper-forge) 10 分,StellaMary 发表于 2 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 philipwhiuk 发表于 6 分钟前 [–] 开源方式当然由大家决定,但我不太确定大量编译后的代码是好的做法:https://github.com/Shyam20001/rsjs 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

This template provides a minimal setup to get React working in Vite with HMR and Brahma-Firelight (A Rust based high speed server writen on top of TOKIO & HYPER)

npm install
npm run build
npm run dev

To set API proxy during dev (vite.config.ts/js)

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  server: {
    proxy: {
      "/api": {
        target: "http://localhost:2000", // your backend port (brahma-firelight API)
        changeOrigin: true,
        secure: false,
      },
    },
  },
});

Brahma-Firelight The Ultra Fast Rust based JavaScript Framework Read Docs

联系我们 contact @ memedata.com