smf

5 分钟搭建 Node.js 微服务原型

99封情书 提交于 2020-03-11 16:41:37
微服务已成为在 Node.js 中构建可扩展且强大的云应用的主流方法。同时也存在一些门槛,其中一些难点需要你在以下方面做出决策: 组织项目结构。 将自定义服务连接到第三方服务(数据库,消息代理等) 处理微服务之间共享的代码。 将项目容器化。 在本地运行和调试,然后将其部署到云中。 SMF 框架是开箱即用的解决方案: https://github.com/krawa76/smf 让我们看看它如何帮你创建和部署微服务原型而 无需编写任何代码。 创建项目 安装框架,创建一个新项目并 cd 到项目目录: 1$ npm install -g sokyra-microservice-factory 2$ smf new test-stack 3$ cd test-stack 带有演示服务的样板代码已生成,我们可以轻松地运行该项目: 1$ smf up 这将生成 Docker工件(docker-compose 和环境变量文件),构建映像并在本地运行容器: docker-compose 日志 如果在编辑器中打开项目,则会看到带有 main.ts 模块的自动生成的 demo 服务,该服务在上面的日志中生成了记录。其他的重要文件是 smf-stack.json (项目配置), smf-env.json (容器 env 变量),通用的 Dockerfile 和 smf-docker.yml

MySQL count all children no matter how many there are

拜拜、爱过 提交于 2019-12-13 01:18:50
问题 I am developing a simple system that has unlimited categories and items in each category. For instance there could be categories inside categories etc (Category 1 -> Category 2 -> Category 3) all containing items. I want to display the total items for each category and ALL of their subcategories. I am trying to figure out a loop to do this but basically am coming up short. I am building in PHP/MySQL. My category table schema is category(id, id_parent) id being auto increment and id_parent

Register And Login To SMF With CURL

帅比萌擦擦* 提交于 2019-12-10 12:04:44
问题 I'm working on a website that has a forum area, I will probably use the SMF forum software for the forum. Users can register and log in on the website. I would like to achieve that when they register on the website, they get also registered on the forum (they don't have to register twice). And also when they log in to the website that would also log them into the forum so they don't have to log in twice. I think this should be possible with curl but I need to see some example code so I can