Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wang
/
go_supplier_task
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
d4dcb6ed
authored
Feb 03, 2021
by
wang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update.sh
parent
be7b17dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletions
.gitignore
cmd/http/http_server.go
.gitignore
View file @
d4dcb6ed
...
@@ -15,7 +15,7 @@ cmd.exe~
...
@@ -15,7 +15,7 @@ cmd.exe~
/mylogs
/mylogs
/doc/test
/doc/test
/vm.sh
/vm.sh
/cmd/http
/cmd/http
/http
/doc/spuTest
/doc/spuTest
/doc/test3
/doc/test3
...
...
cmd/http/http_server.go
0 → 100644
View file @
d4dcb6ed
package
main
import
(
"flag"
"github.com/gin-gonic/gin"
"github.com/micro/go-micro/v2/web"
"golang_open_platform/boot"
"golang_open_platform/pkg/config"
"golang_open_platform/routes"
)
func
main
()
{
var
path
string
flag
.
StringVar
(
&
path
,
"config"
,
"conf"
,
"配置文件"
)
flag
.
Parse
()
if
err
:=
boot
.
Boot
(
path
);
err
!=
nil
{
panic
(
err
)
}
gin
.
SetMode
(
config
.
Get
(
"web.mode"
)
.
String
())
r
:=
routes
.
InitRouter
()
port
:=
config
.
Get
(
"web.port"
)
.
String
()
//web改成micro 就是grpc,并直接注册到etcd里面
service
:=
web
.
NewService
(
web
.
Name
(
"go.micro.api.http.search"
),
web
.
Handler
(
r
),
web
.
Address
(
":"
+
port
),
)
if
err
:=
service
.
Init
();
err
!=
nil
{
panic
(
err
)
}
if
err
:=
service
.
Run
();
err
!=
nil
{
panic
(
err
)
}
}
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