###### tags: `node js` # 簡單nodejs API - 在該專案資料夾下cmd執行指令,即可啟動伺服器。 ```shell node ./index.js ``` - port: 65432 - 帳號密碼皆為root - token 過期時間為 3分鐘 - 伺服器上有2隻API:/login與/auth - /login - method: post - 需要的資料JSON: ```jsonld { username: 帳號, password: 密碼 } ``` - 驗證成功回傳的JSON: ```jsonld { status: true, token: string, username: 帳號 } ``` - 驗證失敗回傳的JSON: ```json { status: false, } ``` - /auth - method: post - 需要的資料JSON: ```json { token: string } ``` - 驗證成功回傳的JSON: ```jsonld { status: true, token: string, username: 帳號 } ``` - 驗證失敗回傳的JSON: ```json { status: false, } ``` [檔案在這](https://github.com/s16777216/simple-node-server-for-jwt/tree/master)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up