Star-Wars-api

所属分类:Web服务器
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2017-04-22 18:05:37
上 传 者sh-1993
说明:  以《星球大战》为中心具有端点的小型express服务器。希望这将向我们展示制作express应用程序的能力...,
(A small express server with endpoints centered around Star Wars. This will hopefully demonstrate to us abilities to make an express app, consume data from an API, and manipulate that data into some desired way)

文件列表:
LICENSE (1065, 2017-04-22)
package.json (258, 2017-04-22)
server.js (3785, 2017-04-22)
views/ (0, 2017-04-22)
views/pages/ (0, 2017-04-22)
views/pages/character.ejs (590, 2017-04-22)
views/partials/ (0, 2017-04-22)
views/partials/footer.ejs (59, 2017-04-22)
views/partials/head.ejs (202, 2017-04-22)
views/partials/header.ejs (193, 2017-04-22)

# Star-Wars A small express server with endpoints centered around Star Wars. This will hopefully demonstrate to us abilities to make an express app, consume data from an API, and manipulate that data into some desired way. ## Endpoints * '/character/:name' - Returns an EJS view (nothing too fancy) with data about the given character. (Needs to work with at least 'luke', 'han', 'leia', and 'rey') * '/characters' - Returns raw JSON of 50 characters (doesn't matter which 50). This endpoint should be able to take a query parameter in the URL called 'sort' and the potential sort parameters will be 1 of the following, ['name', 'mass', 'height'] So the endpoint '/characters?sort=height' should return JSON of 50 characters sorted by their height. * '/planetresidents' - Return raw JSON in the form {planetName1: [characterName1, characterName2], planetName2: [characterName3]}. So it is an object where the keys are the planet names, and the values are lists of residents names for that planet ## How to use * install all the dependencies using 'npm install' * execute server.js in node ## Examples * https://star-wars-njs.herokuapp.com/character/Quarsh * https://star-wars-njs.herokuapp.com/characters?sort=height * https://star-wars-njs.herokuapp.com/planetresidents?page=1

近期下载者

相关文件


收藏者