<commit_before>"use strict";
/*
 Created by lx on 2016/11/17
 Name: <NAME>
 */
const express = require('express');
const router = express.Router();
const data = require("../data");
const cityData = data.city;
// router get 顺序？

// get-1: Return all the tags of all cities.
router.get("/tags/", (req, res) => {
    cityData.getAllCities().then((cityList) => {
        let tags = [];
        cityList.forEach((city) => {
            city.tag.forEach((tag) => {
                tags.push(tag);
            })
        })
        // 如何输出tag不重复？
        res.render('city/tagList', { list: tags });
        // res.json(tags);
    }, () => {
        res.sendStatus(500);
    });
});

// get-2: Return all the cities(name, province, country), such as "Wuhan, Hubei, China".
router.get("/", (req, res) => {
    cityData.getAllCities().then((cityList) => {
        res.render('city/cityList', { list: cityList });
        // res.json(cityInfo);
    }, () => {
        res.sendStatus(500);
    });
});<commit_msg>Update city.js<commit_after>"use strict";
/*
 Created by lx on 2016/11/17
 Name: <NAME>
 */
const express = require('express');
const router = express.Router();
const data = require("../data");
const cityData = data.city;
// router get 顺序？

// get-1: Return all the tags of all cities.
router.get("/tags/", (req, res) => {
    cityData.getAllCities().then((cityList) => {
        let tags = [];
        cityList.forEach((city) => {
            city.tag.forEach((tag) => {
                tags.push(tag);
            })
        })
        // 如何输出tag不重复？
        res.render('city/tagList', { list: tags });
        // res.json(tags);
    }, () => {
        res.sendStatus(500);
    });
});

// get-2: Return all the cities(name, province, country), such as "Wuhan, Hubei, China".
router.get("/", (req, res) => {
    cityData.getAllCities().then((cityList) => {
        res.json(cityList);
    }, () => {
        res.sendStatus(500);
    });
});
{'fraction_non_alphanumeric': 0.20277920741121977, 'fraction_numerical': 0.016469377251672673, 'mean_word_length': 2.2562814070351758, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4575310', 'n_tokens_mistral': 668, 'n_tokens_neox': 649, 'n_words': 134}