Skip to content

后台部署

章节视频教程

点击:02-灵沐部署

Docker安装

感谢kodashen提供

https://hub.docker.com/r/kodashen/lingmu-app

Strapi安装

宝塔左侧菜单点击文件到wwwwroot目录下运行终端需要SSH密码 灵沐开源资源下载小程序

安装yarn

sh
npm i -g yarn

安装strapi(默认安装SQLite数据库)

sh
yarn create strapi-app my-project --quickstart

进入到my-project安装依赖

sh
yarn install

my-project目录建立server.js文件

javascript
// path: `./server.js`
const strapi = require('@strapi/strapi');
strapi().start();

API

宝塔后台找到src目录将下载好的小程序源码中的APIcompomemts以及extensions上传解压
灵沐开源资源下载小程序

中文

stapi默认给的是英文语言,可以用浏览器自带的翻译器翻译。若切换中文需先在后台设置中添加语言,步骤1执行到步骤4 灵沐开源资源下载小程序

宝塔后台目录中目录下/src/admin中新建app.js文件复制代码

javascript
export default {
  config: {
    locales: ['zh-Hans']
  },
  bootstrap() {},
}

编译

sh
yarn build

灵沐开源资源下载小程序

最后在步骤5中个人信息设置中切换为中文

注意

第一次安装进入后台会让你注册一个用户

权限

strapi后台设置--角色列表---Pubilc,API中的字段需要设置权限不然无法访问

注意

category,post,wxSet,dySet都要设置

灵沐开源资源下载小程序

映射

左侧菜单点击网站—Node项目—添加Node项目

注意

设置端口1337和映射域名宝塔和服务器需放行该端口

灵沐开源资源下载小程序

映射域名后回到宝塔左侧菜单网站最后显示。点击设置开始部署SSL 灵沐开源资源下载小程序

小程序

小程序源码导入微信开发工具utils/http.js修改域名信息 小程序升级