You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Security Best Practices Intent This document intends to extend the current threat model and provide extensive guidelines on how to secure a Node.js application. Document Content Best practices: A simplified condensed way to see the best practices. We can use this issue or this guideline as the starting point. It is important to note that this document is specific to Node.js, if you are looking for
server を使った test をしたい時、 その環境で使われていなさそうな port をあれこれ確かめたりしていた時代が僕にもありました。んで、それはさすがに無駄なので random port を取るためのモジュール を作っちゃったりしてたんですが、こんなことをしなくても server.listen(0) にするだけでrandom port とれます。 const http = require('http'); const server = http.createServer((req, res) => { res.end('hello'); }); server.listen(0); server.on('listening', () => { // ここで random port が取れる const port = server.address().port; }); なんでこんな
バッチを作成しようとルすると、コマンド引数で動作変更したいことがあります。 今回は Node.js でコマンド引数の受け取り方および解析を行う方法についてまとめました。 コマンド引数解析は自作すると面倒なので commander モジュールを利用した方法を載せています。 基本 Node.js においてコマンドライン引数は process.argv で受け取れます。 コマンド引数の保存先 process.argv インデックス 0 は node へのパス インデックス 1 は 実行 JavaScript のパス インデックス 2 以降にコマンド引数が与えられます。 実際のソースコード、実行、結果の関係をサンプルコードとしてみると以下のようになります。 ソース(index.js) for (let i = 0; i < process.argv.length; i++) { console.l
Most web applications rely on some sort of access control to keep users from accessing information not meant for them. If authentication is a lock on the main door of the hotel, then access control is the individual access card they give to each user for accessing their room. We have spent quite a few blog posts on various theories about security mechanisms for web applications (Set Up a Secure No
var smtpConfig = { host: 'smtp.gmail.com', port: 465, secure: true, // SSL auth: { user: 'なんとか@gmail.com', pass: 'パスワード' } }; this.transporter = mailer.createTransport(smtpConfig) Gmailの設定 二段階認証がONの場合: アプリパスワードみたいなもので認証 二段階認証がOFFの場合: 安全性の低いアプリの許可を有効にする? 以下のようなエラーが出る場合 response: '534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbun\n534-5.7.14 Js5HEiTBKrTKTK_QrftVcMYM7A
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く