• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

MLH/mlh-localhost-github: This repo contains the source code for the MLH Localho ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

MLH/mlh-localhost-github

开源软件地址:

https://github.com/MLH/mlh-localhost-github

开源编程语言:

JavaScript 51.1%

开源软件介绍:

MLH Localhost Hometown Map

This repository contains the source code for a map of the hometowns of anyone who attends the MLH Localhost workshop, How to Collaborate on Code Projects with GitHub. Participants learn best practice GitHub workflows, add their hometown to locations.txt, and see the giant community they're part of!

How to participate in this workshop

  1. Make a GitHub account.
  2. Fork this repository.
  3. Add your hometown to locations.txt.
  4. Commit your changes and make a pull request.
  5. Ask someone else to comment on your pull request.
  6. Wait for the workshop organizer to approve your pull request.
  7. Refresh the map!

Technologies used in this project

GitHub Actions

GitHub actions allows us to run a NodeJS script automatically when a commit is pushed to the project. That script takes all the locations provided and turns them into latitude & longitude coordinates.

GitHub Pages

GitHub pages lets us host our map on GitHub as a webpage.

NodeJS

We chose to use NodeJS as the language to turn all the hometown names into coordinates.

dotenv

Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.

node-geocoder

Node library for geocoding and reverse geocoding.

Try the application locally, if you want!

Google Maps API Key

To use the Google Maps JavaScript API, you will ned an API Key. The API key is used to track API requests associated with your project for usage and billing. To learn more about API keys, see the API Key Best Practices and the FAQs.

Adding a new location

The App reads its locations from the locations.txt file located in the root folder. It will consider each line a different location, so the file should look something like this:

New York, USA
Brazil
Japan

To add a new location, simply append a new line to the locations.txt file

Running the application:

To run this application locally, you'll need to:

  • Clone this repository:
git clone https://github.com/MLH/mlh-localhost-github.git
cd localhost-github
npm install
  • Set up environment variables:

There is a .env.example file that can be used to configure the app. Simply create a copy named .env

GOOGLE_API_KEY= # Google Maps API KEY

Now inside the root folder run the following:

npm geocode

This will turn each line in the locations.txt into a set of coordinates.

You can see your own map by running:

npm start



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
bellshade/Git: Repositori untuk belajar Git dan Github.发布时间:2022-06-11
下一篇:
charleso/git-cc: Bridge for Git and Clearcase发布时间:2022-06-11
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap