技术控

    今日:96| 主题:49531
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] You Don't Know Jacks: Learn to Make Your Code More Secure

[复制链接]
单曲循环、谁在唱歌 发表于 2016-11-30 12:13:38
163 1

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
I used to play a game called You Don't Know Jack . It's a trivia game, set as a game show, in which it's fun to lose. Upon giving an incorrect answer, the player is treated to a witty and irreverent reprimand from the game's host.
  It's also an abject lesson in how little details mean the difference between getting something right and getting something horribly, embarrassingly wrong.
   Recently, I was asked to write about Jacks . I'd never heard of it before, but it was immediately interesting to me. You see, there aren't many services that claim to help you as you learn about how to code securely. Jacks wants to be that service. Almost like a coach. That never sleeps. And costs nothing.
  Unlike the trivia game, it's more forgiving. That's great when you really don't know what you're doing - as I found out when I decided to learn a new web framework.
   Most of the code for this post can be found on Github . I've tested it in Node 7.0.0 , on macOS Sierra 10.12.1 .
  Getting Hapi

   I've written many little NodeJS applications, and I've often found Express to be just enough for my web application needs. But I've also wondered how best to structure a much larger application. There are opinionated options, like Adonis , but I'm already quite familiar with it. What new thing could I learn, while also kicking Jacks' tires?
   And then I saw mention of Hapi on Jacks' home page .
  I opened my terminal, made a new project folder, and installed Hapi:
  [code]yarn add hapi[/code]   You can also install Hapi using NPM . I'm just a sucker for trends, and Yarn is pretty darn fast!
  According to the docs, making a Hapi application is as easy as:
  [code]"use strict" const hapi = require("hapi") const server = new hapi.Server() server.connection({ "port": 3000, }) server.route({ "method": "get", "path": "/", handler: function (request, reply) { reply("hello world") }, }) server.start(err => { if (err) { throw err } console.log("server at " + server.info.uri) })[/code]   If you've used Express, this should look somewhat familiar to you. I've created a new HTTP server, with a single route. When a browser requests / , this route will reply with hello world :
   
You Don't Know Jacks: Learn to Make Your Code More Secure-1 (difference,framework,something,Recently,services)

  Plugging In

  The next step was to connect my Github account to Jacks. Creating a Jacks account was rather effortless, and free. First I set up a new project:

You Don't Know Jacks: Learn to Make Your Code More Secure-2 (difference,framework,something,Recently,services)

  ...and then I connected my Github account (and the project repository) to Jacks:
1234下一页
友荐云推荐




上一篇:Pure CSS Horizontal Scrolling | CSS-Tricks
下一篇:现有系统做微服务架构改进经验分享
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

氧气 发表于 2016-11-30 18:06:32
沙发抢不到,板凳也行啊!
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表