Gorose orm+dotweb Framework Quick Build Go Web site combat (vi)

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Website on-line operation and summary

Test run

In the previous section, we finished all the service-side code, so let's try running it first.

    • Start the service

      go run main.go

      The following information will be printed:

      start...,port:8888, visit: http://localhost:8888

      Description, our service is running.

    • Browser input Access

      http://localhost:8888

      The "Quick News homepage", which we set up in our route, is running perfectly.

    • Get a piece of news data under test

      http://localhost:8888/getnewsbyid?id=1

      The browser will print out the following information:

      {    "data": {        "content": "新闻啊新闻新闻啊新闻",        "created_at": "2018-01-23 16:31:53",        "id": 1,        "status": 1,        "updated_at": null    },    "msg": "success",    "status": 200}

      The data service is also a perfect success

Deploy on-line

When it comes to deployment, go is one of the easiest projects I've ever seen, and there are several ways to do it on the web, and here's a simple example.

    • Packaging services

      go build main.go
    • Running the service

      nohup ./main &

Yes, that's it, it's running, it's gone.

Summarize

This series of tutorials just made a simple example of a Web site process and played a starting effect.
Specific use of the process, according to their own needs, to make the appropriate adjustments can help people seeking to get started quickly through the two-pulse bar

Description: As far as the front page, I write casually, I use the vue front-end framework here, follow-up opportunities, I will record this process, temporarily first, the source is together

The project Source: Https://github.com/gohouse/kuaixinwen

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.