หากคุณต้องการเพิ่มการตรวจสอบความถูกต้องตามโทเค็นที่ปลอดภัย (JSON Web) อย่างรวดเร็วในโครงการของคุณโปรดตรวจสอบเอกสารของ Auth0 และแผนฟรีที่ Developer.auth0.com |
ในการเพิ่มไลบรารีเพียงแก้ไขไฟล์ JSON ที่เหมาะสมที่อยู่ที่ views/website/libraries
แต่ละภาษาได้รับไฟล์ของตัวเอง ไลบรารีหลายรายการแชร์ไฟล์ภาษาเดียวกัน
ในการเพิ่มภาษาใหม่เพียงเพิ่มไฟล์ JSON ในโฟลเดอร์เดียวกับอื่น ๆ มันจะได้รับการยอมรับโดยอัตโนมัติ หากคุณเพิ่มภาษาใหม่คุณจะต้องจัดเตรียมไอคอนที่เหมาะสมและวางไว้ในโฟลเดอร์ img
นี่คือตัวอย่างความคิดเห็นของไฟล์ภาษา. NET ( 0-.NET.json
) ฟิลด์ทั้งหมดต้องมีค่าที่ถูกต้องเว้นแต่จะระบุ:
{
// Language name (unique)
"name" : ".NET" ,
// Unique identifier that will be used as a CSS class
// for this language (only valid CSS class names).
"uniqueClass" : "net" ,
// The language icon, SVG format preferred, should be placed
// in /img directory.
"image" : "/img/1.svg" ,
// The color of header that displays the name of the language
// and the icon. This is a valid CSS color definition.
"bgColor" : "rgb(42, 168, 229)" ,
// An array of libraries for this language.
"libs" : [
{
// In case the library suffered from a vulnerability, the
// minimum version in which the vuln was fixed must be
// listed here. Optional (can be null).
"minimumVersion" : "1.0.1" , // or null
// Supported features, true for supported,
// false for not supported.
"support" : {
"sign" : true ,
"verify" : true ,
"iss" : true ,
"sub" : true ,
"aud" : true ,
"exp" : true ,
"nbf" : true ,
"iat" : true ,
"jti" : true ,
"hs256" : true ,
"hs384" : true ,
"hs512" : true ,
"rs256" : true ,
"rs384" : true ,
"rs512" : true ,
"es256" : true ,
"es384" : true ,
"es512" : true ,
"ps256" : true ,
"ps384" : true ,
"ps512" : true ,
"eddsa" : true
} ,
// Author URL, can be GitHub profile, personal page
// company page, etc. Can be null.
"authorUrl" : "https://www.microsoft.com" , // or null
// Author name.
"authorName" : "Microsoft" ,
// For the star count, this is the GitHub repository path,
// (usually user/repo). Can be null (no star count shown).
"gitHubRepoPath" : "AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet" , // or null
// URL for source code.
"repoUrl" : "https://github.com/MSOpenTech/azure-activedirectory-identitymodel-extensions-for-dotnet" ,
// Install command, can be HTML or plain text.
"installCommandHtml" : "Install-Package<br><a href="https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/">System.IdentityModel.Tokens.Jwt</a>"
}
]
}
ขั้นแรกให้ติดตั้งการพึ่งพาที่ต้องการ:
npm install
เพื่อสร้าง (และเรียกใช้) โครงการดำเนินการ:
./node_modules/.bin/grunt
คุณจะพบไฟล์ที่สร้างขึ้นในไดเรกทอรี dist
สำหรับเว็บไซต์คุณสามารถเรียกใช้เซิร์ฟเวอร์ที่รูท ตัวอย่างเช่น: http-server dist/website
งาน grunt
เริ่มต้นทำงานเซิร์ฟเวอร์ที่ https://127.0.0.1:8000 และดูการเปลี่ยนแปลง
ในการเรียกใช้การทดสอบดำเนินการ:
./node_modules/.bin/grunt test
ดูที่จุดสิ้นสุดของ Gruntfile สำหรับงานทั่วไปอื่น ๆ