![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
egg-jacky-hello
Advanced tools
Egg's JWT(JSON Web Token Authentication Plugin)
egg-jwt@3 use koa-jwt2
$ npm i egg-jacky-hello --save
or
yarn add egg-jacky-hello
// {app_root}/config/plugin.js
exports.jwt = {
enable: true,
package: "egg-jacky-hello"
};
// {app_root}/config/config.default.js
exports.jwt = {
secret: "123456"
};
see config/config.default.js for more detail.
// app/router.js
"use strict";
module.exports = app => {
app.get("/", app.jwt, "render.index"); // use old api app.jwt
app.get("/login", "login.index");
app.get("/success", "success.index"); // is setting in config.jwt.match
};
// app/controller/render.js
("use strict");
module.exports = app => {
class RenderController extends app.Controller {
*index() {
this.ctx.body = "hello World";
}
}
return RenderController;
};
// app/controller/login.js
("use strict");
module.exports = app => {
class LoginController extends app.Controller {
*index() {
this.ctx.body = "hello admin";
}
}
return LoginController;
};
// app/controller/success.js
("use strict");
module.exports = app => {
class SuccessController extends app.Controller {
*index() {
this.ctx.body = this.ctx.state.user;
}
}
return SuccessController;
};
Then
curl 127.0.0.1:7001
// response 401
curl 127.0.0.1:7001/login
// response hello admin
curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIiLCJpYXQiOjE0OTAwMTU0MTN9.ehQ38YsRlM8hDpUMKYq1rHt-YjBPSU11dFm0NOroPEg" 127.0.0.1:7001/success
// response {foo: bar}
const token = app.jwt.sign({ foo: 'bar' }, app.config.jwt.secret);
For more options, check here
Please open an issue here.
FAQs
hello plugin for egg
The npm package egg-jacky-hello receives a total of 1 weekly downloads. As such, egg-jacky-hello popularity was classified as not popular.
We found that egg-jacky-hello demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.