微服务网关2-搭建Gateway服务
2024-10-07 00:33:56
一、创建父模块infrastructure
1、创建模块
在guli_parent下创建普通maven模块
Artifact:infrastructure
2、删除src目录
二、创建模块api_gateway
1、创建模块
在infrastructure下创建普通maven模块
Artifact:api_gateway
2、配置pom
在api_gateway的pom中添加如下依赖
<dependencies>
<!-- 网关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
</dependencies>
3、配置application.yml
server:
port: 9110 # 服务端口
spring:
profiles:
active: dev # 环境设置
application:
name: infrastructure-apigateway # 服务名
4、logback.xml
修改日志输出的目录名为 apigateway
<property name="log.path" value="D:/project/helen/guli_log/apigateway" />
5、创建启动类
package com.atguigu.guli.infrastructure.apigateway;
@SpringBootApplication
public class InfrastructureApiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(InfrastructureApiGatewayApplication.class, args);
}
}
6、启动网关
最新文章
- slide效果
- 根据条件动态拼接LinQ的where条件字串
- php strrpos()与strripos()函数不同之处在哪里呢
- IE浏览器模式设置
- C# WebRequestExtensions
- [ CodeVS冲杯之路 ] P1092
- Android:单元测试
- TreeMap与TreeSet的实现
- 转:C#整数三种强制类型转换int、Convert.ToInt32()、int.Parse()的区别
- selenium 学习笔记 ---新手学习记录(9) 问题总结(java)
- hive on spark的安装及问题
- #define和typedef在windows上的应用
- 》》stroll--各种特效下拉菜单
- 操作系统与cpu
- iframe实现Ajax文件上传效果示例
- JS 字符串两边截取空白的trim()方法的封装
- mysql 存储过程 有数据修改 没数据插入
- window对象方法之setTimeout(),setInterval()
- Intellij IDEA导入web项目详解(解决访问的404)
- USB2.0相关应用笔记集锦
热门文章
- Erlang那些事儿第2回之我是模块(module),一文件一模块
- Java 从 Map 到 HashMap 的一步步实现
- C#未能找到路径“\bin\roslyn\csc.exe”的一部分。
- html中table表格标题固定表数据行出现滚动条
- Selenium Web元素操作
- Spring Boot 中使用 Quartz 实现任务调度
- 设计模式之-Builder模式
- 大白话Java多线程,小白都能看的懂的哦
- Java学习日报7.31
- 基于Let&#39;s Encrypt生成免费证书-支持多域名泛域名证书