Giter VIP home page Giter VIP logo

kuizuo-protocol's Introduction

Artwork from Nuxt

Protocol

🧪 一个用于快速复现请求协议的 Web 开发模板。

🖥 Online Preview

size size CI License

✨ 目的

如果你恰好使用 Node.js 来请求api接口或者爬虫,并且部署在 Web 上,那么基于本模板将会特别容易做到。

🚀 快速开始

git clone https://github.com/kuizuo/protocol
cd protocol
pnpm i
pnpm run dev
  • 将 public/logo.svg 换成你想要展示的 logo
  • 修改 app.config.ts 中的配置(标题,描述),并通过 useConfig() 获取配置
  • 在 content 目录下修改 help.mdchangelog.md 以更新使用说明与更新日志。支持 MDC Syntax
  • 在 server/api 下编写你的后端请求接口。在 server/protocol 下编写协议请求核心逻辑便于调用
  • nitro.config.ts 配置数据存储位置,并使用 useStorage() 来存取数据,得益于unjs/unstorage
  • 前端使用 ohmyfetch 来请求后端接口,有完善的接口类型提示

🎉 部署

服务器

这里使用 pm2 进行部署,创建 ecosystem.config.js 文件:

module.exports = {
  apps: [
    {
      name: 'Protocol',
      exec_mode: 'cluster',
      instances: '1',
      env: {
        NITRO_PORT: 8010,
        NITRO_HOST: '127.0.0.1',
        NODE_ENV: 'production',
      },
      script: './.output/server/index.mjs',
    },
  ],
}

接着执行 pm2 start ecosystem.config.js 即可。

Vercel

转到 Vercel 并选择你的项目,点击 "Deploy",您的应用程序将在一分钟内上线。

Netlify

转到 Netlify 并选择您的项目,点击 "Deploy site",您的应用程序将在一分钟内上线。

🖥️ 演示

preview

🤝 免责声明

本模板仅仅是web模板,任何开发者用该模板编写任何站点都与本人无关。本项目仅作为个人技术专研,仅供学习参考。

📝 License

MIT License © 2022-PRESENT Kuizuo

kuizuo-protocol's People

Contributors

kuizuo avatar

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.