Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7a6ecd69
authored
Jun 08, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
启动配置
parent
ebe0a3af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
bat/coursehttp.bat
cmd/course_http_server.go
conf/config.ini
bat/coursehttp.bat
View file @
7a6ecd69
set MICRO_REGISTRY=etcd
set MICRO_REGISTRY_ADDRESS=192.168.2.232:2379
go run ../cmd/course_http_server.go --server_address :9000
\ No newline at end of file
go run ../cmd/course_http_server.go
\ No newline at end of file
cmd/course_http_server.go
View file @
7a6ecd69
...
...
@@ -8,12 +8,12 @@ import (
"search_server/boot"
_
"search_server/controller"
"search_server/framework/gin_"
"search_server/pkg/config"
)
func
main
()
{
var
path
,
temp
string
var
path
string
flag
.
StringVar
(
&
path
,
"config"
,
"../conf/config.ini"
,
"配置文件"
)
flag
.
StringVar
(
&
temp
,
"server_address"
,
"conf/config.ini"
,
"配置文件"
)
flag
.
Parse
()
if
err
:=
boot
.
Boot
(
path
);
err
!=
nil
{
log
.
Println
(
err
)
...
...
@@ -22,11 +22,14 @@ func main() {
r
:=
gin
.
New
()
gin_
.
BootStrap
(
r
)
port
:=
config
.
Get
(
"web.port"
)
.
String
()
//web改成micro 就是grpc,并直接注册到etcd里面
service
:=
web
.
NewService
(
web
.
Name
(
"go.micro.api.http.course"
),
web
.
Handler
(
r
),
web
.
Address
(
":"
+
port
),
)
if
err
:=
service
.
Init
();
err
!=
nil
{
log
.
Println
(
err
)
}
...
...
conf/config.ini
View file @
7a6ecd69
[web]
port
=
9000
[database]
user_name
=
root
password
=
root
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment