Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
huolongshe a0c3dcd1b0 | 11 months ago | |
---|---|---|
app | 1 year ago | |
webapp | 2 years ago | |
.gitignore | 2 years ago | |
Dockerfile | 11 months ago | |
LICENSE | 2 years ago | |
README.md | 1 year ago | |
application.yml | 1 year ago | |
build-docker.sh | 2 years ago | |
pip-install-reqs.sh | 1 year ago | |
requirements.txt | 1 year ago | |
start.py | 2 years ago |
papp1是基于 ServiceBoot微服务引擎 开发的 CubePy微服务框架 前端微服务样例程序,其前端界面基于Angular框架,使用TypeScript和HTML等语言开发。
papp1目前实现了一个简单的个人博客前端界面,通过与后端微服务uapp1和uapp2进行交互来完成博客撰写和访问功能。开发者可以参考该样例程序来开发自己的微服务前端。
监听端口
服务注册与发现:
下载代码并安装前端依赖包
第一次从Git服务器克隆本项目代码后,应先在本项目 webapp 目录下执行如下命令以安装前端开发需要的Node依赖:
$ cd webapp
$ npm install
开发环境中运行portal之前,需要先拉起项目依赖的后台docker。
$ cd ~/cubenet/cubepy/dev
$ docker-compose up
参见 CubePy微服务框架 之README文档。
分别运行各前后端基础微服务:uaa、gateway、portal,以及本样例程序的后端微服务uapp1、uapp2。
使用PyCharm打开本project所在目录。
建议在PyCharm中专门为本project新建一个专用Python虚拟环境,Python版本选择3.5以上。
在PyCharm的terminal窗口中执行如下命令安装依赖包:
$ sh pip-install-reqs.sh
在PyCharm窗口中右键单击“start.py”文件,选择“run 'start'”来启动前端服务。
每次前端代码改动后,在terminal窗口中运行:
$ cd webapp
$ ng build
或者
$ ng build --prod
来完成代码编译。
然后在浏览器中打开或刷新页面:
http://127.0.0.1:8080
gateway网关会自动将主页面路由至portal微服务来提供前端界面服务。
为了能在主页界面中显示并有效操作该应用,首次登录时需要执行如下操作:
以admin帐号登录,或者具有ROLE_ADMIN角色的其他用户帐号登录。
进入“系统管理|角色管理”页面,添加一个新角色:ROLE_BLOG。
进入“系统管理|用户管理”页面,新建一个用户,并为该用户添加角色:ROLE_BLOG。
进入“系统管理|应用管理”页面,创建一个新应用:
退出admin用户,以新创建的用户身份登录。
各前端微服务的Angular代码修改之后,重复执行上述第8-9步。
开发完成后,可在terminal窗口中执行如下命令来生成微服务docker镜像:
$ serviceboot build_docker
或者
$ sh build-docker.sh
CUbeAI微服务框架——前端微服务开发样例1
JavaScript SVG CSS HTML TypeScript other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》