demo: http://nextjs.i18ntech.com/ (with bootstrap https://github.com/nextjs-boilerplate/bootstrap )
包含内容 include:
如果需要一个jwt的版本,可以参考 https://github.com/nextjs-boilerplate/next-express-redux-i18n
if you want jwt version, refer https://github.com/nextjs-boilerplate/next-express-redux-i18n
多国语言和reudx,这东西在React上应该是标配了,我们却还总是需要去单独集成他们,eslint代码规范也是很必要的,还有新潮一点的http2
I18n and Redux should be standard for React, still we need to apply using them for every project, and eslint for code smell, and http2 for future
安全,当所有的逻辑客户端都可以看到(即使你混淆了代码),服务端客户端一套代码让我们更容易维护逻辑,同时,作弊也变得更容易。你的关键接口必须和身份验证紧密合作,才能保证数据安全,csrf+Cookie/csrf+token是最基本最易于定制的身份凭据。
Security, now all your logic are available by the browser (even if you use uglify), one logic for both server side and browser make your easier to maintain your logic while cheating become more easier. You must keep your data api work with user identity closely, to make your data safe, csrf+Cookie/csrf+token is the most basical and efficient way.
git checkout https://github.com/postor/nextjs-cookie-example.git
cd nextjs-cookie-example
npm install
node server.js
yarn test
显示测试在第一次运行时只会生成对应截图,不进行比对
visual test will only generate screenshots for the first time
你需要根据你的环境配置puppeteer,可以调整package.json中的scripts.jest配置 和 tests/utils.js中的launch函数
you need to config puppeteer according to your env, in package.json you can modify scripts.jest and in tests/utils.js modify launch function
Content type
Image
Digest
Size
199.3 MB
Last updated
over 8 years ago
docker pull postor/nextjs-devops