url-shortener:URL 缩短服务的简单原型

时间:2021-06-24 12:47:12
【文件属性】:
文件名称:url-shortener:URL 缩短服务的简单原型
文件大小:13KB
文件格式:ZIP
更新时间:2021-06-24 12:47:12
JavaScript URL 缩短服务的原型 一个简单的 URL 缩短应用程序。 POST /shorten为查询参数link指定的 URL 生成一个短 URL id GET /{id}解析给定id指向的 URL(如果未找到则返回 404,如果被列入黑名单则返回 403) 要尝试运行npm install && npm run serve : 在浏览器中:导航到http://localhost:9000/ 从命令行: curl -X POST -H -d 'link=http://example.com' http://localhost:9000/shorten curl http://localhost:9000/SOME_ID_HERE 东西不见了 前端测试 防止 CSRF 对无 JavaScript 客户端的合理支持
【文件预览】:
url-shortener-master
----index.js(88B)
----package.json(714B)
----test()
--------server.js(4KB)
----LICENSE.md(1KB)
----.gitignore(738B)
----lib()
--------config.js(227B)
--------urlStore.js(310B)
--------server.js(1KB)
--------routes()
--------urlValidator.js(465B)
--------shortener.js(1KB)
--------main.js(120B)
--------logger.js(76B)
----public()
--------index.html(10KB)
--------favicon.ico(318B)
----README.md(640B)
----.jshintrc(326B)
----.editorconfig(354B)

网友评论