{"id":746,"date":"2012-08-26T00:23:58","date_gmt":"2012-08-26T07:23:58","guid":{"rendered":"http:\/\/h2plus.biz\/hiromitsu\/?p=746"},"modified":"2018-08-06T14:10:38","modified_gmt":"2018-08-06T21:10:38","slug":"sequelize%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e8%aa%8d%e8%a8%bc%ef%bc%8f%e5%ae%9f%e8%a3%85%e7%b7%a8-2","status":"publish","type":"post","link":"https:\/\/h2plus.biz\/hiromitsu\/entry\/746","title":{"rendered":"Sequelize\u3092\u4f7f\u3063\u3066\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\uff0f\u5b9f\u88c5\u7de8"},"content":{"rendered":"<p><a href=\"http:\/\/h2plus.biz\/hiromitsu\/entry\/694\">\u8a2d\u8a08\u7de8<\/a>\u304b\u3089\u3060\u3044\u3076\u9593\u304c\u3042\u3044\u3066\u3057\u307e\u3063\u305f\u304c\u3001<code>routes\/auth.js<\/code>\u306b\u67a0\u7d44\u307f\u3060\u3051\u4f5c\u3063\u305f<code>auth<\/code>\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5b9f\u88c5\u3092\u57cb\u3081\u3066\u3044\u3053\u3046\u3002<\/p>\n<p>\u30b9\u30bf\u30fc\u30c8\u5730\u70b9\u306f\u3053\u306e\u6bb5\u968e\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nmodule.exports = function(models) {\r\n  var User = models.user;\r\n\r\n  return {\r\n      signup: function(req, res) {\r\n      }\r\n\r\n    , login: function(req, res) {\r\n      }\r\n\r\n    , logout: function(req, res) {\r\n      }\r\n  };\r\n};\r\n<\/pre>\n<p><!--more--><\/p>\n<h4>\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7<\/h4>\n<p><code>signup<\/code>\u30e1\u30bd\u30c3\u30c9\u306e\u5f79\u5272\u306f\u65b0\u898f\u30e6\u30fc\u30b6\u30fc\u3092\u767b\u9332\u3059\u308b\u3053\u3068\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u30dc\u30c7\u30a3\u304b\u3089<code>username<\/code>\u3068<code>password<\/code>\u306e2\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8aad\u307f\u53d6\u3063\u3066\u3001<code>User<\/code>\u30e2\u30c7\u30eb\u3092\u4ecb\u3057\u3066 DB\u306b\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nsignup: function(req, res) {\r\n  var username = req.body.username || null\r\n    , password = req.body.password || null;\r\n\r\n  if(!username || !password) {\r\n    res.statusCode = 403;\r\n    res.end({ error: 'Shortage of params' });\r\n    return;\r\n  }\r\n\r\n  User.create({\r\n      username: username\r\n    , password: User.hashPassword(password)\r\n  })\r\n  .success(function(user) {\r\n    user = user.values;\r\n    delete user.password;\r\n    res.end(user);\r\n  })\r\n  .error(function(error) {\r\n    res.statusCode = 500;\r\n    res.end({ error: error });\r\n  });\r\n}\r\n<\/pre>\n<p>11-14\u884c\u76ee\uff1aDB\u306b\u30ec\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u30e2\u30c7\u30eb\u306e<code>create<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3002\u5f15\u6570\u306f\u65b0\u3057\u3044\u30ec\u30b3\u30fc\u30c9\u306e\u30c7\u30fc\u30bf\u3092\u8868\u3059\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30ea\u30c6\u30e9\u30eb\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u30dc\u30c7\u30a3\u304b\u3089\u8aad\u307f\u53d6\u3063\u305f<code>password<\/code>\u306f\u5e73\u6587\u306a\u306e\u3067\u3001<code>User<\/code>\u30e2\u30c7\u30eb\u306e\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u5b9f\u88c5\u3057\u305f<code>hashPassword<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u30cf\u30c3\u30b7\u30e5\u5024\u306b\u5909\u63db\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>15-19\u884c\u76ee\uff1a\u30ec\u30b3\u30fc\u30c9\u306e\u8ffd\u52a0\u304c\u6210\u529f\u3059\u308b\u3068<code>success<\/code>\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3057\u305f\u95a2\u6570\u304c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3055\u308c\u3001\u8ffd\u52a0\u3055\u308c\u305f\u30e2\u30c7\u30eb\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u5f15\u6570\u306b\u6e21\u3055\u308c\u308b\u3002\u8ffd\u52a0\u3055\u308c\u305f\u30ec\u30b3\u30fc\u30c9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f<code>values<\/code>\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u3046\u3002\u4f8b\u3048\u3070\u3001\u81ea\u52d5\u9023\u756a\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3084\u3001\u73fe\u5728\u6642\u523b\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u6642\u523b\u30c7\u30fc\u30bf\u306e\u3088\u3046\u306b\u3001\u8ffd\u52a0\u6642\u306b\u78ba\u5b9a\u3059\u308b\u3088\u3046\u306a\u30c7\u30fc\u30bf\u3082<code>values<\/code>\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u306f\u542b\u307e\u308c\u3066\u3044\u308b\u3002<code>password<\/code>\u30ab\u30e9\u30e0\u306f\u30cf\u30c3\u30b7\u30e5\u5316\u3055\u308c\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u3060\u304c\u3001\u5916\u90e8\u306b\u6f0f\u3089\u3059\u3053\u3068\u306f\u306a\u3044\u306e\u3067\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u306f\u9001\u4fe1\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>20-23\u884c\u76ee\uff1a<code>error<\/code>\u30e1\u30bd\u30c3\u30c9\u306b\u306f\u30ec\u30b3\u30fc\u30c9\u306e\u8ffd\u52a0\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\uff08\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30e9\uff09\u3092\u6e21\u3059\u3002<\/p>\n<p>\u30ec\u30b3\u30fc\u30c9\u306e\u8ffd\u52a0\u306f<code>create<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u4ee5\u5916\u306b\u3001<code>build<\/code>\u30e1\u30bd\u30c3\u30c9\u3068<code>save<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u5225\u3005\u306b\u547c\u3073\u51fa\u3059\u65b9\u6cd5\u3082\u3042\u308b\u3002\u30c7\u30fc\u30bf\u306e\u8ffd\u52a0\u524d\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3046\u306e\u304c\u3088\u304f\u3042\u308b\u30b1\u30fc\u30b9\u3060\u308d\u3046\u3002\u4f8b\u3048\u3070\u3001<code>username<\/code>\u30ab\u30e9\u30e0\u3092\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5f62\u5f0f\u306b\u3059\u308b\u3088\u3046\u306b\u4ed5\u69d8\u3092\u5909\u3048\u305f\u3068\u3057\u305f\u5834\u5408\u3001<code>User<\/code>\u30e2\u30c7\u30eb\u306e\u5b9a\u7fa9\u6642\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3082\u542b\u3081\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: jscript; highlight: [7]; title: ; notranslate\" title=\"\">\r\n\/\/ models\/user.js\r\nmodule.exports = function(sequelize, DataTypes) {\r\n    return sequelize.define('user', {\r\n        username: {\r\n            type: DataTypes.STRING\r\n          , unique: true\r\n          , validate: { isEmail: true }\r\n        }\r\n      , password: 'char(40)'\r\n    });\r\n};\r\n<\/pre>\n<p>\u30c7\u30fc\u30bf\u8ffd\u52a0\u524d\u306b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3046\u306b\u306f\u3001\u5148\u306b<code>build<\/code>\u30e1\u30bd\u30c3\u30c9\u3067\u30e2\u30c7\u30eb\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\u3066<code>validate<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3002<\/p>\n<pre class=\"brush: jscript; first-line: 11; title: ; notranslate\" title=\"\">\r\n  var new_user = User.build({\r\n          username: username\r\n        , password: User.hashPassword(password)\r\n      })\r\n    , invalid = new_user.validate();\r\n\r\n  if(invalid) {\r\n    res.statusCode = 403;\r\n    res.end({ error: 'Invalid param', detail: invalid });\r\n    return;\r\n  }\r\n\r\n  new_user.save()\r\n  .success(function(user) {\r\n    ...\r\n  })\r\n  .error(function(error) {\r\n    ...\r\n  });\r\n<\/pre>\n<p><code>validate<\/code>\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30e2\u30c7\u30eb\u5b9a\u7fa9\u306e<code>validate<\/code>\u3067\u6307\u5b9a\u3057\u305f\u30eb\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3044\u3001\u4f55\u3082\u30a8\u30e9\u30fc\u304c\u306a\u3051\u308c\u3070<code>null<\/code>\u304c\u8fd4\u3063\u3066\u304f\u308b\u3002<a href=\"http:\/\/docs.sequelizejs.com\/#models-validations\">Sequelize\u306b\u6a19\u6e96\u3067\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u30d0\u30ea\u30c7\u30fc\u30bf<\/a>\u304c\u305f\u304f\u3055\u3093\u3042\u308b\u306e\u3067\u898b\u3066\u304a\u304f\u3068\u3044\u3044\u3060\u308d\u3046\u3002<\/p>\n<p>\u3059\u3067\u306b<a href=\"http:\/\/h2plus.biz\/hiromitsu\/entry\/694\">\u8a2d\u8a08\u7de8<\/a>\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306f\u5b9f\u88c5\u3057\u3066\u3044\u308b\u306e\u3067\u3001<code>curl<\/code>\u3092\u4f7f\u3063\u3066\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3092\u5b9f\u884c\u3057\u3066\u307f\u3088\u3046\u3002<\/p>\n<pre>\n$ curl -X POST -d 'username=h2plus&password=pass' localhost:3000\/auth\/signup\n<\/pre>\n<h4>\u30ed\u30b0\u30a4\u30f3<\/h4>\n<p><code>login<\/code>\u30e1\u30bd\u30c3\u30c9\u306e\u5f79\u5272\u306f\u30e6\u30fc\u30b6\u30fc\u3092\u8a8d\u8a3c\u3059\u308b\u3053\u3068\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u30dc\u30c7\u30a3\u304b\u3089<code>username<\/code>\u3068<code>password<\/code>\u306e2\u3064\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8aad\u307f\u53d6\u3063\u3066\u3001<code>User<\/code>\u30e2\u30c7\u30eb\u3092\u4ecb\u3057\u3066 DB\u304b\u3089\u30ec\u30b3\u30fc\u30c9\u3092\u691c\u7d22\u3059\u308b\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nlogin: function(req, res) {\r\n  var username = req.body.username || null\r\n    , password = req.body.password || null;\r\n\r\n  if(!username || !password) {\r\n    res.statusCode = 403;\r\n    res.end({ error: 'Shortage of params' });\r\n    return;\r\n  }\r\n\r\n  User.find({\r\n      where: {\r\n          username: username\r\n        , password: User.hashPassword(password)\r\n      }\r\n  })\r\n  .success(function(user) {\r\n    if(user) {\r\n      user = user.values;\r\n      delete user.password;\r\n      req.session.user_id = user.id;\r\n      res.send(user);\r\n    }\r\n    else {\r\n      res.statusCode = 403;\r\n      res.end({ error: 'Authentication failure' });\r\n    }\r\n  })\r\n  .error(function(error) {\r\n    res.statusCode = 500;\r\n    res.end({ error: error });\r\n  });\r\n}\r\n<\/pre>\n<p>11-16\u884c\u76ee\uff1a1\u4ef6\u306e\u30ec\u30b3\u30fc\u30c9\u3092\u691c\u7d22\u3059\u308b\u306b\u306f<code>find<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3002\u5f15\u6570\u306b\u306f\u691c\u7d22\uff08<code>SELECT<\/code>\u6587\uff09\u306e\u6761\u4ef6\u306a\u3069\u3092\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u4eca\u56de\u306f\u30e6\u30fc\u30b6\u30fc\u8a8d\u8a3c\u304c\u76ee\u7684\u306a\u306e\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092<code>WHERE<\/code>\u53e5\u306b\u6307\u5b9a\u3057\u3066\u691c\u7d22\u3057\u3066\u3044\u308b\u3002\u8907\u6570\u4ef6\u306e\u30ec\u30b3\u30fc\u30c9\u3092\u691c\u7d22\u3059\u308b\u5834\u5408\u306f\u3001<code>findAll<\/code>\uff08\u307e\u305f\u306f<code>all<\/code>\uff09\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3002<\/p>\n<p>18-23\u884c\u76ee\uff1a\u691c\u7d22\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3001\u30ec\u30b3\u30fc\u30c9\u304c\u898b\u3064\u304b\u3063\u305f\u5834\u5408\u306f\u3001\u8a72\u5f53\u30ec\u30b3\u30fc\u30c9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306e\u5f15\u6570\u306b\u6e21\u3063\u3066\u304f\u308b\u3002\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3067\u4f7f\u3063\u305f<code>create<\/code>\u3068\u540c\u69d8\u306b\u30c7\u30fc\u30bf\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f<code>values<\/code>\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u3046\u3002\u30ec\u30b3\u30fc\u30c9\u304c\u898b\u3064\u304b\u3063\u305f\u3068\u3044\u3046\u3053\u3068\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u305f\u8a3c\u306a\u306e\u3067\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u306b<code>id<\/code>\u30ab\u30e9\u30e0\u3092\u4fdd\u5b58\u3057\u3066\u304a\u304f\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>24-27\u884c\u76ee\uff1a\u691c\u7d22\u306e\u7d50\u679c\u3001\u30ec\u30b3\u30fc\u30c9\u304c\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408\u3082<code>success<\/code>\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3057\u305f\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u304c\u547c\u3073\u51fa\u3055\u308c\u308b\u304c\u3001\u5f15\u6570\u306f<code>null<\/code>\u306b\u306a\u3063\u3066\u3044\u308b\u3002<code>error<\/code>\u30e1\u30bd\u30c3\u30c9\u5074\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u304c\u547c\u3070\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3067\u6ce8\u610f\u3002<\/p>\n<p>\u5148\u307b\u3069\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3057\u305f\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u3001<code>curl<\/code>\u304b\u3089\u30ed\u30b0\u30a4\u30f3\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\u3002\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u306b\u306fCookie\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u3001<code>-c<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3067CookieJar\u306b\u4fdd\u5b58\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u3053\u3046\u3002<\/p>\n<pre>\n$ curl -c ~\/.cookies -X POST -d 'username=h2plus&password=pass' localhost:3000\/auth\/login\n<\/pre>\n<h4>\u30ed\u30b0\u30a2\u30a6\u30c8<\/h4>\n<p><code>logout<\/code>\u30e1\u30bd\u30c3\u30c9\u306e\u5f79\u5272\u306f\u65e2\u5b58\u306e\u30ed\u30b0\u30a4\u30f3\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7834\u68c4\u3059\u308b\u3053\u3068\u3002\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u3001\u30ed\u30b0\u30a4\u30f3\u306b\u6bd4\u3079\u308b\u3068\u3001DB\u30a2\u30af\u30bb\u30b9\u3082\u306a\u3044\u306e\u3067\u7c21\u7d20\u306a\u5b9f\u88c5\u306b\u306a\u308b\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nlogout: function(req, res) {\r\n  req.session.destroy();\r\n  res.end();\r\n}\r\n<\/pre>\n<p><code>curl<\/code>\u3067\u306e\u30ed\u30b0\u30a2\u30a6\u30c8\u5b9f\u884c\u6642\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u6642\u3068\u540c\u3058CookieJar\u3092<code>-b<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<pre>\n$ curl -b ~\/.cookies -X POST localhost:3000\/auth\/logout\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8a2d\u8a08\u7de8\u304b\u3089\u3060\u3044\u3076\u9593\u304c\u3042\u3044\u3066\u3057\u307e\u3063\u305f\u304c\u3001routes\/auth.js\u306b\u67a0\u7d44\u307f\u3060\u3051\u4f5c\u3063\u305fauth\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5b9f\u88c5\u3092\u57cb\u3081\u3066\u3044\u3053\u3046\u3002 \u30b9\u30bf\u30fc\u30c8\u5730\u70b9\u306f\u3053\u306e\u6bb5\u968e\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[77],"tags":[225,241,244,243,242],"_links":{"self":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts\/746"}],"collection":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/comments?post=746"}],"version-history":[{"count":1,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts\/746\/revisions"}],"predecessor-version":[{"id":1005,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/posts\/746\/revisions\/1005"}],"wp:attachment":[{"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/media?parent=746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/categories?post=746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h2plus.biz\/hiromitsu\/wp-json\/wp\/v2\/tags?post=746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}