Commit 3b271928796628aeaaf3eb036364a2b8ff8aa05a
1 parent
bc4f4548
feat(api): add api for editor
Showing
52 changed files
with
1055 additions
and
0 deletions
Too many changes to show.
To preserve performance only 52 of 53 files are displayed.
back-end/h5-api/.editorconfig
0 → 100644
| 1 | +root = true | |
| 2 | + | |
| 3 | +[*] | |
| 4 | +indent_style = space | |
| 5 | +indent_size = 2 | |
| 6 | +end_of_line = lf | |
| 7 | +charset = utf-8 | |
| 8 | +trim_trailing_whitespace = true | |
| 9 | +insert_final_newline = true | |
| 10 | + | |
| 11 | +[{package.json,*.yml}] | |
| 12 | +indent_style = space | |
| 13 | +indent_size = 2 | |
| 14 | + | |
| 15 | +[*.md] | |
| 16 | +trim_trailing_whitespace = false | ... | ... |
back-end/h5-api/.eslintignore
0 → 100644
back-end/h5-api/.eslintrc
0 → 100644
| 1 | +{ | |
| 2 | + "parser": "babel-eslint", | |
| 3 | + "extends": "eslint:recommended", | |
| 4 | + "env": { | |
| 5 | + "commonjs": true, | |
| 6 | + "es6": true, | |
| 7 | + "node": true, | |
| 8 | + "browser": false | |
| 9 | + }, | |
| 10 | + "parserOptions": { | |
| 11 | + "ecmaFeatures": { | |
| 12 | + "experimentalObjectRestSpread": true, | |
| 13 | + "jsx": false | |
| 14 | + }, | |
| 15 | + "sourceType": "module" | |
| 16 | + }, | |
| 17 | + "globals": { | |
| 18 | + "strapi": true | |
| 19 | + }, | |
| 20 | + "rules": { | |
| 21 | + "indent": ["error", 2, { "SwitchCase": 1 }], | |
| 22 | + "linebreak-style": ["error", "unix"], | |
| 23 | + "no-console": 0, | |
| 24 | + "quotes": ["error", "single"], | |
| 25 | + "semi": ["error", "always"] | |
| 26 | + } | |
| 27 | +} | ... | ... |
back-end/h5-api/.gitignore
0 → 100644
| 1 | +############################ | |
| 2 | +# OS X | |
| 3 | +############################ | |
| 4 | + | |
| 5 | +.DS_Store | |
| 6 | +.AppleDouble | |
| 7 | +.LSOverride | |
| 8 | +Icon | |
| 9 | +.Spotlight-V100 | |
| 10 | +.Trashes | |
| 11 | +._* | |
| 12 | + | |
| 13 | + | |
| 14 | +############################ | |
| 15 | +# Linux | |
| 16 | +############################ | |
| 17 | + | |
| 18 | +*~ | |
| 19 | + | |
| 20 | + | |
| 21 | +############################ | |
| 22 | +# Windows | |
| 23 | +############################ | |
| 24 | + | |
| 25 | +Thumbs.db | |
| 26 | +ehthumbs.db | |
| 27 | +Desktop.ini | |
| 28 | +$RECYCLE.BIN/ | |
| 29 | +*.cab | |
| 30 | +*.msi | |
| 31 | +*.msm | |
| 32 | +*.msp | |
| 33 | + | |
| 34 | + | |
| 35 | +############################ | |
| 36 | +# Packages | |
| 37 | +############################ | |
| 38 | + | |
| 39 | +*.7z | |
| 40 | +*.csv | |
| 41 | +*.dat | |
| 42 | +*.dmg | |
| 43 | +*.gz | |
| 44 | +*.iso | |
| 45 | +*.jar | |
| 46 | +*.rar | |
| 47 | +*.tar | |
| 48 | +*.zip | |
| 49 | +*.com | |
| 50 | +*.class | |
| 51 | +*.dll | |
| 52 | +*.exe | |
| 53 | +*.o | |
| 54 | +*.seed | |
| 55 | +*.so | |
| 56 | +*.swo | |
| 57 | +*.swp | |
| 58 | +*.swn | |
| 59 | +*.swm | |
| 60 | +*.out | |
| 61 | +*.pid | |
| 62 | + | |
| 63 | + | |
| 64 | +############################ | |
| 65 | +# Logs and databases | |
| 66 | +############################ | |
| 67 | + | |
| 68 | +.tmp | |
| 69 | +*.log | |
| 70 | +*.sql | |
| 71 | +*.sqlite | |
| 72 | +*.sqlite3 | |
| 73 | + | |
| 74 | + | |
| 75 | +############################ | |
| 76 | +# Misc. | |
| 77 | +############################ | |
| 78 | + | |
| 79 | +*# | |
| 80 | +ssl | |
| 81 | +.idea | |
| 82 | +nbproject | |
| 83 | +public/uploads/* | |
| 84 | +!public/uploads/.gitkeep | |
| 85 | + | |
| 86 | +############################ | |
| 87 | +# Node.js | |
| 88 | +############################ | |
| 89 | + | |
| 90 | +lib-cov | |
| 91 | +lcov.info | |
| 92 | +pids | |
| 93 | +logs | |
| 94 | +results | |
| 95 | +node_modules | |
| 96 | +.node_history | |
| 97 | + | |
| 98 | + | |
| 99 | +############################ | |
| 100 | +# Tests | |
| 101 | +############################ | |
| 102 | + | |
| 103 | +testApp | |
| 104 | +coverage | |
| 105 | + | |
| 106 | +############################ | |
| 107 | +# Strapi | |
| 108 | +############################ | |
| 109 | + | |
| 110 | +exports | |
| 111 | +.cache | |
| 112 | +build | ... | ... |
back-end/h5-api/README.md
0 → 100644
back-end/h5-api/api/.gitkeep
0 → 100644
back-end/h5-api/api/work/config/routes.json
0 → 100644
| 1 | +{ | |
| 2 | + "routes": [ | |
| 3 | + { | |
| 4 | + "method": "GET", | |
| 5 | + "path": "/works", | |
| 6 | + "handler": "Work.find", | |
| 7 | + "config": { | |
| 8 | + "policies": [] | |
| 9 | + } | |
| 10 | + }, | |
| 11 | + { | |
| 12 | + "method": "GET", | |
| 13 | + "path": "/works/count", | |
| 14 | + "handler": "Work.count", | |
| 15 | + "config": { | |
| 16 | + "policies": [] | |
| 17 | + } | |
| 18 | + }, | |
| 19 | + { | |
| 20 | + "method": "GET", | |
| 21 | + "path": "/works/:id", | |
| 22 | + "handler": "Work.findOne", | |
| 23 | + "config": { | |
| 24 | + "policies": [] | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "method": "POST", | |
| 29 | + "path": "/works", | |
| 30 | + "handler": "Work.create", | |
| 31 | + "config": { | |
| 32 | + "policies": [] | |
| 33 | + } | |
| 34 | + }, | |
| 35 | + { | |
| 36 | + "method": "PUT", | |
| 37 | + "path": "/works/:id", | |
| 38 | + "handler": "Work.update", | |
| 39 | + "config": { | |
| 40 | + "policies": [] | |
| 41 | + } | |
| 42 | + }, | |
| 43 | + { | |
| 44 | + "method": "DELETE", | |
| 45 | + "path": "/works/:id", | |
| 46 | + "handler": "Work.delete", | |
| 47 | + "config": { | |
| 48 | + "policies": [] | |
| 49 | + } | |
| 50 | + } | |
| 51 | + ] | |
| 52 | +} | ... | ... |
back-end/h5-api/api/work/controllers/Work.js
0 → 100644
back-end/h5-api/api/work/models/Work.js
0 → 100644
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Lifecycle callbacks for the `Work` model. | |
| 5 | + */ | |
| 6 | + | |
| 7 | +module.exports = { | |
| 8 | + // Before saving a value. | |
| 9 | + // Fired before an `insert` or `update` query. | |
| 10 | + // beforeSave: async (model, attrs, options) => {}, | |
| 11 | + | |
| 12 | + // After saving a value. | |
| 13 | + // Fired after an `insert` or `update` query. | |
| 14 | + // afterSave: async (model, response, options) => {}, | |
| 15 | + | |
| 16 | + // Before fetching a value. | |
| 17 | + // Fired before a `fetch` operation. | |
| 18 | + // beforeFetch: async (model, columns, options) => {}, | |
| 19 | + | |
| 20 | + // After fetching a value. | |
| 21 | + // Fired after a `fetch` operation. | |
| 22 | + // afterFetch: async (model, response, options) => {}, | |
| 23 | + | |
| 24 | + // Before fetching all values. | |
| 25 | + // Fired before a `fetchAll` operation. | |
| 26 | + // beforeFetchAll: async (model, columns, options) => {}, | |
| 27 | + | |
| 28 | + // After fetching all values. | |
| 29 | + // Fired after a `fetchAll` operation. | |
| 30 | + // afterFetchAll: async (model, response, options) => {}, | |
| 31 | + | |
| 32 | + // Before creating a value. | |
| 33 | + // Fired before an `insert` query. | |
| 34 | + // beforeCreate: async (model, attrs, options) => {}, | |
| 35 | + | |
| 36 | + // After creating a value. | |
| 37 | + // Fired after an `insert` query. | |
| 38 | + // afterCreate: async (model, attrs, options) => {}, | |
| 39 | + | |
| 40 | + // Before updating a value. | |
| 41 | + // Fired before an `update` query. | |
| 42 | + // beforeUpdate: async (model, attrs, options) => {}, | |
| 43 | + | |
| 44 | + // After updating a value. | |
| 45 | + // Fired after an `update` query. | |
| 46 | + // afterUpdate: async (model, attrs, options) => {}, | |
| 47 | + | |
| 48 | + // Before destroying a value. | |
| 49 | + // Fired before a `delete` query. | |
| 50 | + // beforeDestroy: async (model, attrs, options) => {}, | |
| 51 | + | |
| 52 | + // After destroying a value. | |
| 53 | + // Fired after a `delete` query. | |
| 54 | + // afterDestroy: async (model, attrs, options) => {} | |
| 55 | +}; | ... | ... |
back-end/h5-api/api/work/models/Work.settings.json
0 → 100644
| 1 | +{ | |
| 2 | + "connection": "default", | |
| 3 | + "collectionName": "work", | |
| 4 | + "info": { | |
| 5 | + "name": "work", | |
| 6 | + "description": "用户的一个H5作品" | |
| 7 | + }, | |
| 8 | + "options": { | |
| 9 | + "increments": true, | |
| 10 | + "timestamps": [ | |
| 11 | + "created_at", | |
| 12 | + "updated_at" | |
| 13 | + ], | |
| 14 | + "comment": "" | |
| 15 | + }, | |
| 16 | + "attributes": { | |
| 17 | + "title": { | |
| 18 | + "required": true, | |
| 19 | + "type": "string" | |
| 20 | + }, | |
| 21 | + "description": { | |
| 22 | + "type": "text" | |
| 23 | + }, | |
| 24 | + "cover_image_url": { | |
| 25 | + "type": "string" | |
| 26 | + }, | |
| 27 | + "is_publish": { | |
| 28 | + "type": "boolean" | |
| 29 | + }, | |
| 30 | + "create_time": { | |
| 31 | + "type": "date" | |
| 32 | + }, | |
| 33 | + "update_time": { | |
| 34 | + "type": "date" | |
| 35 | + }, | |
| 36 | + "pages": { | |
| 37 | + "type": "json" | |
| 38 | + } | |
| 39 | + } | |
| 40 | +} | |
| 0 | 41 | \ No newline at end of file | ... | ... |
back-end/h5-api/api/work/services/Work.js
0 → 100644
back-end/h5-api/config/application.json
0 → 100644
back-end/h5-api/config/custom.json
0 → 100644
back-end/h5-api/config/environments/development/custom.json
0 → 100644
back-end/h5-api/config/environments/development/database.json
0 → 100644
back-end/h5-api/config/environments/development/request.json
0 → 100644
| 1 | +{ | |
| 2 | + "session": { | |
| 3 | + "enabled": true, | |
| 4 | + "client": "cookie", | |
| 5 | + "key": "strapi.sid", | |
| 6 | + "prefix": "strapi:sess:", | |
| 7 | + "secretKeys": ["mySecretKey1", "mySecretKey2"], | |
| 8 | + "httpOnly": true, | |
| 9 | + "maxAge": 86400000, | |
| 10 | + "overwrite": true, | |
| 11 | + "signed": false, | |
| 12 | + "rolling": false | |
| 13 | + }, | |
| 14 | + "logger": { | |
| 15 | + "level": "debug", | |
| 16 | + "exposeInContext": true, | |
| 17 | + "requests": true | |
| 18 | + }, | |
| 19 | + "parser": { | |
| 20 | + "enabled": true, | |
| 21 | + "multipart": true | |
| 22 | + } | |
| 23 | +} | ... | ... |
back-end/h5-api/config/environments/development/response.json
0 → 100644
back-end/h5-api/config/environments/development/security.json
0 → 100644
| 1 | +{ | |
| 2 | + "csrf": { | |
| 3 | + "enabled": false, | |
| 4 | + "key": "_csrf", | |
| 5 | + "secret": "_csrfSecret" | |
| 6 | + }, | |
| 7 | + "csp": { | |
| 8 | + "enabled": false, | |
| 9 | + "policy": { | |
| 10 | + "default-src": "'self'" | |
| 11 | + } | |
| 12 | + }, | |
| 13 | + "p3p": { | |
| 14 | + "enabled": false, | |
| 15 | + "value": "" | |
| 16 | + }, | |
| 17 | + "hsts": { | |
| 18 | + "enabled": false, | |
| 19 | + "maxAge": 31536000, | |
| 20 | + "includeSubDomains": true | |
| 21 | + }, | |
| 22 | + "xframe": { | |
| 23 | + "enabled": false, | |
| 24 | + "value": "SAMEORIGIN" | |
| 25 | + }, | |
| 26 | + "xss": { | |
| 27 | + "enabled": false, | |
| 28 | + "mode": "block" | |
| 29 | + }, | |
| 30 | + "cors": { | |
| 31 | + "enabled": true, | |
| 32 | + "origin": "*", | |
| 33 | + "expose": [ | |
| 34 | + "WWW-Authenticate", | |
| 35 | + "Server-Authorization" | |
| 36 | + ], | |
| 37 | + "maxAge": 31536000, | |
| 38 | + "credentials": true, | |
| 39 | + "methods": [ | |
| 40 | + "GET", | |
| 41 | + "POST", | |
| 42 | + "PUT", | |
| 43 | + "PATCH", | |
| 44 | + "DELETE", | |
| 45 | + "OPTIONS", | |
| 46 | + "HEAD" | |
| 47 | + ], | |
| 48 | + "headers": [ | |
| 49 | + "Content-Type", | |
| 50 | + "Authorization", | |
| 51 | + "X-Frame-Options", | |
| 52 | + "Origin" | |
| 53 | + ] | |
| 54 | + }, | |
| 55 | + "ip": { | |
| 56 | + "enabled": false, | |
| 57 | + "whiteList": [], | |
| 58 | + "blackList": [] | |
| 59 | + } | |
| 60 | +} | ... | ... |
back-end/h5-api/config/environments/development/server.json
0 → 100644
back-end/h5-api/config/environments/production/custom.json
0 → 100644
back-end/h5-api/config/environments/production/database.json
0 → 100644
| 1 | +{ | |
| 2 | + "defaultConnection": "default", | |
| 3 | + "connections": { | |
| 4 | + "default": { | |
| 5 | + "settings": { | |
| 6 | + "client": "sqlite", | |
| 7 | + "host": "${process.env.DATABASE_HOST || '127.0.0.1'}", | |
| 8 | + "port": "${process.env.DATABASE_PORT || 27017}", | |
| 9 | + "srv": "${process.env.DATABASE_SRV || false}", | |
| 10 | + "database": "${process.env.DATABASE_NAME || 'strapi'}", | |
| 11 | + "username": "${process.env.DATABASE_USERNAME || ''}", | |
| 12 | + "password": "${process.env.DATABASE_PASSWORD || ''}", | |
| 13 | + "ssl": "${process.env.DATABASE_SSL || false}" | |
| 14 | + }, | |
| 15 | + "options": { | |
| 16 | + "ssl": "${process.env.DATABASE_SSL || false}", | |
| 17 | + "authenticationDatabase": "${process.env.DATABASE_AUTHENTICATION_DATABASE || ''}" | |
| 18 | + } | |
| 19 | + } | |
| 20 | + } | |
| 21 | +} | ... | ... |
back-end/h5-api/config/environments/production/request.json
0 → 100644
| 1 | +{ | |
| 2 | + "session": { | |
| 3 | + "enabled": true, | |
| 4 | + "client": "cookie", | |
| 5 | + "key": "strapi.sid", | |
| 6 | + "prefix": "strapi:sess:", | |
| 7 | + "secretKeys": ["mySecretKey1", "mySecretKey2"], | |
| 8 | + "httpOnly": true, | |
| 9 | + "maxAge": 86400000, | |
| 10 | + "overwrite": true, | |
| 11 | + "signed": false, | |
| 12 | + "rolling": false | |
| 13 | + }, | |
| 14 | + "logger": { | |
| 15 | + "level": "info", | |
| 16 | + "exposeInContext": true, | |
| 17 | + "requests": false | |
| 18 | + }, | |
| 19 | + "parser": { | |
| 20 | + "enabled": true, | |
| 21 | + "multipart": true | |
| 22 | + } | |
| 23 | +} | ... | ... |
back-end/h5-api/config/environments/production/response.json
0 → 100644
back-end/h5-api/config/environments/production/security.json
0 → 100644
| 1 | +{ | |
| 2 | + "csrf": { | |
| 3 | + "enabled": false, | |
| 4 | + "key": "_csrf", | |
| 5 | + "secret": "_csrfSecret" | |
| 6 | + }, | |
| 7 | + "csp": { | |
| 8 | + "enabled": true, | |
| 9 | + "policy": [{ | |
| 10 | + "img-src": "'self' http:" | |
| 11 | + }, | |
| 12 | + "block-all-mixed-content" | |
| 13 | + ] | |
| 14 | + }, | |
| 15 | + "p3p": { | |
| 16 | + "enabled": true, | |
| 17 | + "value": "" | |
| 18 | + }, | |
| 19 | + "hsts": { | |
| 20 | + "enabled": true, | |
| 21 | + "maxAge": 31536000, | |
| 22 | + "includeSubDomains": true | |
| 23 | + }, | |
| 24 | + "xframe": { | |
| 25 | + "enabled": true, | |
| 26 | + "value": "SAMEORIGIN" | |
| 27 | + }, | |
| 28 | + "xss": { | |
| 29 | + "enabled": true, | |
| 30 | + "mode": "block" | |
| 31 | + }, | |
| 32 | + "cors": { | |
| 33 | + "enabled": true, | |
| 34 | + "origin": "*", | |
| 35 | + "expose": [ | |
| 36 | + "WWW-Authenticate", | |
| 37 | + "Server-Authorization" | |
| 38 | + ], | |
| 39 | + "maxAge": 31536000, | |
| 40 | + "credentials": true, | |
| 41 | + "methods": [ | |
| 42 | + "GET", | |
| 43 | + "POST", | |
| 44 | + "PUT", | |
| 45 | + "PATCH", | |
| 46 | + "DELETE", | |
| 47 | + "OPTIONS", | |
| 48 | + "HEAD" | |
| 49 | + ], | |
| 50 | + "headers": [ | |
| 51 | + "Content-Type", | |
| 52 | + "Authorization", | |
| 53 | + "X-Frame-Options", | |
| 54 | + "Origin" | |
| 55 | + ] | |
| 56 | + }, | |
| 57 | + "ip": { | |
| 58 | + "enabled": false, | |
| 59 | + "whiteList": [], | |
| 60 | + "blackList": [] | |
| 61 | + } | |
| 62 | +} | ... | ... |
back-end/h5-api/config/environments/production/server.json
0 → 100644
back-end/h5-api/config/environments/staging/custom.json
0 → 100644
back-end/h5-api/config/environments/staging/database.json
0 → 100644
| 1 | +{ | |
| 2 | + "defaultConnection": "default", | |
| 3 | + "connections": { | |
| 4 | + "default": { | |
| 5 | + "settings": { | |
| 6 | + "client": "sqlite", | |
| 7 | + "host": "${process.env.DATABASE_HOST || '127.0.0.1'}", | |
| 8 | + "port": "${process.env.DATABASE_PORT || 27017}", | |
| 9 | + "srv": "${process.env.DATABASE_SRV || false}", | |
| 10 | + "database": "${process.env.DATABASE_NAME || 'strapi'}", | |
| 11 | + "username": "${process.env.DATABASE_USERNAME || ''}", | |
| 12 | + "password": "${process.env.DATABASE_PASSWORD || ''}", | |
| 13 | + "ssl": "${process.env.DATABASE_SSL || false}" | |
| 14 | + }, | |
| 15 | + "options": { | |
| 16 | + "ssl": "${process.env.DATABASE_SSL || false}", | |
| 17 | + "authenticationDatabase": "${process.env.DATABASE_AUTHENTICATION_DATABASE || ''}" | |
| 18 | + } | |
| 19 | + } | |
| 20 | + } | |
| 21 | +} | ... | ... |
back-end/h5-api/config/environments/staging/request.json
0 → 100644
| 1 | +{ | |
| 2 | + "session": { | |
| 3 | + "enabled": true, | |
| 4 | + "client": "cookie", | |
| 5 | + "key": "strapi.sid", | |
| 6 | + "prefix": "strapi:sess:", | |
| 7 | + "secretKeys": ["mySecretKey1", "mySecretKey2"], | |
| 8 | + "httpOnly": true, | |
| 9 | + "maxAge": 86400000, | |
| 10 | + "overwrite": true, | |
| 11 | + "signed": false, | |
| 12 | + "rolling": false | |
| 13 | + }, | |
| 14 | + "logger": { | |
| 15 | + "level": "info", | |
| 16 | + "exposeInContext": true, | |
| 17 | + "requests": false | |
| 18 | + }, | |
| 19 | + "parser": { | |
| 20 | + "enabled": true, | |
| 21 | + "multipart": true | |
| 22 | + } | |
| 23 | +} | ... | ... |
back-end/h5-api/config/environments/staging/response.json
0 → 100644
back-end/h5-api/config/environments/staging/security.json
0 → 100644
| 1 | +{ | |
| 2 | + "csrf": { | |
| 3 | + "enabled": false, | |
| 4 | + "key": "_csrf", | |
| 5 | + "secret": "_csrfSecret" | |
| 6 | + }, | |
| 7 | + "csp": { | |
| 8 | + "enabled": true, | |
| 9 | + "policy": [{ | |
| 10 | + "img-src": "'self' http:" | |
| 11 | + }, | |
| 12 | + "block-all-mixed-content" | |
| 13 | + ] | |
| 14 | + }, | |
| 15 | + "p3p": { | |
| 16 | + "enabled": true, | |
| 17 | + "value": "" | |
| 18 | + }, | |
| 19 | + "hsts": { | |
| 20 | + "enabled": true, | |
| 21 | + "maxAge": 31536000, | |
| 22 | + "includeSubDomains": true | |
| 23 | + }, | |
| 24 | + "xframe": { | |
| 25 | + "enabled": true, | |
| 26 | + "value": "SAMEORIGIN" | |
| 27 | + }, | |
| 28 | + "xss": { | |
| 29 | + "enabled": true, | |
| 30 | + "mode": "block" | |
| 31 | + }, | |
| 32 | + "cors": { | |
| 33 | + "enabled": true, | |
| 34 | + "origin": "*", | |
| 35 | + "expose": [ | |
| 36 | + "WWW-Authenticate", | |
| 37 | + "Server-Authorization" | |
| 38 | + ], | |
| 39 | + "maxAge": 31536000, | |
| 40 | + "credentials": true, | |
| 41 | + "methods": [ | |
| 42 | + "GET", | |
| 43 | + "POST", | |
| 44 | + "PUT", | |
| 45 | + "PATCH", | |
| 46 | + "DELETE", | |
| 47 | + "OPTIONS", | |
| 48 | + "HEAD" | |
| 49 | + ], | |
| 50 | + "headers": [ | |
| 51 | + "Content-Type", | |
| 52 | + "Authorization", | |
| 53 | + "X-Frame-Options", | |
| 54 | + "Origin" | |
| 55 | + ] | |
| 56 | + }, | |
| 57 | + "ip": { | |
| 58 | + "enabled": false, | |
| 59 | + "whiteList": [], | |
| 60 | + "blackList": [] | |
| 61 | + } | |
| 62 | +} | ... | ... |
back-end/h5-api/config/environments/staging/server.json
0 → 100644
back-end/h5-api/config/functions/bootstrap.js
0 → 100644
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * An asynchronous bootstrap function that runs before | |
| 5 | + * your application gets started. | |
| 6 | + * | |
| 7 | + * This gives you an opportunity to set up your data model, | |
| 8 | + * run jobs, or perform some special logic. | |
| 9 | + */ | |
| 10 | + | |
| 11 | +module.exports = cb => { | |
| 12 | + cb(); | |
| 13 | +}; | ... | ... |
back-end/h5-api/config/functions/cron.js
0 → 100644
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Cron config that gives you an opportunity | |
| 5 | + * to run scheduled jobs. | |
| 6 | + * | |
| 7 | + * The cron format consists of: | |
| 8 | + * [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK] [YEAR (optional)] | |
| 9 | + */ | |
| 10 | + | |
| 11 | +module.exports = { | |
| 12 | + /** | |
| 13 | + * Simple example. | |
| 14 | + * Every monday at 1am. | |
| 15 | + */ | |
| 16 | + // '0 1 * * 1': () => { | |
| 17 | + // | |
| 18 | + // } | |
| 19 | +}; | ... | ... |
back-end/h5-api/config/functions/responses/404.js
0 → 100644
back-end/h5-api/config/hook.json
0 → 100644
back-end/h5-api/config/language.json
0 → 100644
back-end/h5-api/config/locales/de_de.json
0 → 100644
back-end/h5-api/config/locales/en_us.json
0 → 100644
back-end/h5-api/config/locales/es_es.json
0 → 100644
back-end/h5-api/config/locales/fr_fr.json
0 → 100644
back-end/h5-api/config/locales/it_it.json
0 → 100644
back-end/h5-api/config/locales/ja_jp.json
0 → 100644
back-end/h5-api/config/locales/ru_ru.json
0 → 100644
back-end/h5-api/config/locales/tr_tr.json
0 → 100644
back-end/h5-api/config/middleware.json
0 → 100644
| 1 | +{ | |
| 2 | + "timeout": 100, | |
| 3 | + "load": { | |
| 4 | + "before": [ | |
| 5 | + "responseTime", | |
| 6 | + "logger", | |
| 7 | + "cors", | |
| 8 | + "responses", | |
| 9 | + "gzip" | |
| 10 | + ], | |
| 11 | + "order": [ | |
| 12 | + "Define the middlewares' load order by putting their name in this array is the right order" | |
| 13 | + ], | |
| 14 | + "after": [ | |
| 15 | + "parser", | |
| 16 | + "router" | |
| 17 | + ] | |
| 18 | + } | |
| 19 | +} | ... | ... |
back-end/h5-api/extensions/.gitkeep
0 → 100644
back-end/h5-api/extensions/users-permissions/config/jwt.json
0 → 100644
back-end/h5-api/favicon.ico
0 → 100644
No preview for this file type
back-end/h5-api/package.json
0 → 100644
| 1 | +{ | |
| 2 | + "name": "my-project", | |
| 3 | + "private": true, | |
| 4 | + "version": "0.1.0", | |
| 5 | + "description": "A Strapi application", | |
| 6 | + "scripts": { | |
| 7 | + "develop": "strapi develop", | |
| 8 | + "start": "strapi start", | |
| 9 | + "build": "strapi build", | |
| 10 | + "strapi": "strapi", | |
| 11 | + "lint": "eslint ." | |
| 12 | + }, | |
| 13 | + "devDependencies": { | |
| 14 | + "babel-eslint": "^10.0.0", | |
| 15 | + "eslint": "^6.0.0", | |
| 16 | + "eslint-config-airbnb": "^17.1.0", | |
| 17 | + "eslint-plugin-import": "^2.18.0", | |
| 18 | + "eslint-plugin-react": "^7.14.0" | |
| 19 | + }, | |
| 20 | + "dependencies": { | |
| 21 | + "lodash": "^4.17.5", | |
| 22 | + "strapi": "3.0.0-beta.13", | |
| 23 | + "strapi-admin": "3.0.0-beta.13", | |
| 24 | + "strapi-utils": "3.0.0-beta.13", | |
| 25 | + "strapi-plugin-settings-manager": "3.0.0-beta.13", | |
| 26 | + "strapi-plugin-content-type-builder": "3.0.0-beta.13", | |
| 27 | + "strapi-plugin-content-manager": "3.0.0-beta.13", | |
| 28 | + "strapi-plugin-users-permissions": "3.0.0-beta.13", | |
| 29 | + "strapi-plugin-email": "3.0.0-beta.13", | |
| 30 | + "strapi-plugin-upload": "3.0.0-beta.13", | |
| 31 | + "strapi-hook-bookshelf": "3.0.0-beta.13", | |
| 32 | + "strapi-hook-knex": "3.0.0-beta.13", | |
| 33 | + "knex": "latest", | |
| 34 | + "sqlite3": "latest" | |
| 35 | + }, | |
| 36 | + "author": { | |
| 37 | + "name": "A Strapi developer" | |
| 38 | + }, | |
| 39 | + "strapi": { | |
| 40 | + "uuid": "36048222-d81a-4b06-afae-692a2c020f01" | |
| 41 | + }, | |
| 42 | + "engines": { | |
| 43 | + "node": ">= 10.0.0", | |
| 44 | + "npm": ">= 6.0.0" | |
| 45 | + }, | |
| 46 | + "license": "MIT" | |
| 47 | +} | ... | ... |
back-end/h5-api/public/index.html
0 → 100644
| 1 | +<!doctype html> | |
| 2 | + | |
| 3 | +<html> | |
| 4 | + <head> | |
| 5 | + <meta charset="utf-8" /> | |
| 6 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
| 7 | + <title>Welcome to your Strapi app</title> | |
| 8 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| 9 | + <style> | |
| 10 | + * { | |
| 11 | + -webkit-box-sizing: border-box; | |
| 12 | + } | |
| 13 | + | |
| 14 | + body, html { | |
| 15 | + margin: 0; | |
| 16 | + padding: 40px 0; | |
| 17 | + } | |
| 18 | + | |
| 19 | + body { | |
| 20 | + font: 17px/1.5 "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif; | |
| 21 | + background: white; | |
| 22 | + margin: 0; | |
| 23 | + color: #33333d; | |
| 24 | + overflow-y: scroll; | |
| 25 | + overflow-x: hidden; | |
| 26 | + } | |
| 27 | + | |
| 28 | + h1 { | |
| 29 | + font-size: 1.6em; | |
| 30 | + margin-top: 0; | |
| 31 | + } | |
| 32 | + | |
| 33 | + h2 { | |
| 34 | + margin-top: 44px; | |
| 35 | + font-size: 1.3em; | |
| 36 | + } | |
| 37 | + | |
| 38 | + h3 { | |
| 39 | + margin-top: 30px; | |
| 40 | + font-size: 1em; | |
| 41 | + } | |
| 42 | + | |
| 43 | + section { | |
| 44 | + margin: 0 5.555555555555555%; | |
| 45 | + } | |
| 46 | + | |
| 47 | + p { | |
| 48 | + font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif; | |
| 49 | + } | |
| 50 | + | |
| 51 | + a { | |
| 52 | + color: #33a0c0; | |
| 53 | + } | |
| 54 | + | |
| 55 | + code { | |
| 56 | + font-family: monospace; | |
| 57 | + font-size: 1.1em; | |
| 58 | + } | |
| 59 | + | |
| 60 | + pre { | |
| 61 | + background: white; | |
| 62 | + border-top: 1px solid #eee; | |
| 63 | + border-bottom: 1px solid #eee; | |
| 64 | + padding: 25px; | |
| 65 | + font-family: monospace; | |
| 66 | + overflow-x: auto; | |
| 67 | + } | |
| 68 | + | |
| 69 | + .wrapper { | |
| 70 | + padding: 0 .75em; | |
| 71 | + -webkit-box-sizing: border-box; | |
| 72 | + -moz-box-sizing: border-box; | |
| 73 | + box-sizing: border-box; | |
| 74 | + } | |
| 75 | + | |
| 76 | + @media screen and (min-width:40em) { | |
| 77 | + body { | |
| 78 | + font-size: 1.0625em; | |
| 79 | + } | |
| 80 | + } | |
| 81 | + | |
| 82 | + @media screen and (min-width:45em) { | |
| 83 | + body { | |
| 84 | + font-size: 1em; | |
| 85 | + } | |
| 86 | + } | |
| 87 | + | |
| 88 | + @media screen and (min-width:55.5em) { | |
| 89 | + body { | |
| 90 | + font-size: 1.0625em; | |
| 91 | + } | |
| 92 | + } | |
| 93 | + | |
| 94 | + @media screen and (min-width:61.5em) { | |
| 95 | + body { | |
| 96 | + font-size: 1em; | |
| 97 | + } | |
| 98 | + section { | |
| 99 | + margin: 0 16.666666666666664%; | |
| 100 | + } | |
| 101 | + } | |
| 102 | + | |
| 103 | + @media screen and (min-width:75em) { | |
| 104 | + body { | |
| 105 | + font-size: 1.0625em; | |
| 106 | + } | |
| 107 | + } | |
| 108 | + | |
| 109 | + @media screen and (min-width:87em) { | |
| 110 | + body { | |
| 111 | + font-size: 1em; | |
| 112 | + } | |
| 113 | + section { | |
| 114 | + margin: 0 27.77777777777778%; | |
| 115 | + } | |
| 116 | + } | |
| 117 | + | |
| 118 | + @media screen and (min-width:105em) { | |
| 119 | + body { | |
| 120 | + font-size: 1.0625em; | |
| 121 | + } | |
| 122 | + } | |
| 123 | + | |
| 124 | + @media screen and (min-width:117em) { | |
| 125 | + section { | |
| 126 | + margin: 0 5.555555555555555%; | |
| 127 | + } | |
| 128 | + section .wrapper { | |
| 129 | + width: 37.5%; | |
| 130 | + margin-left: 25%; | |
| 131 | + } | |
| 132 | + } | |
| 133 | + | |
| 134 | + @media screen and (min-width:130em) { | |
| 135 | + body { | |
| 136 | + font-size: 1.125em; | |
| 137 | + max-width: 160em; | |
| 138 | + } | |
| 139 | + } | |
| 140 | + </style> | |
| 141 | + </head> | |
| 142 | + <body lang="en"> | |
| 143 | + <section> | |
| 144 | + <div class="wrapper"> | |
| 145 | + <h1>Welcome.</h1> | |
| 146 | + <p>You successfully created your Strapi application.</p> | |
| 147 | + <p>You are looking at: <code>./public/index.html</code>.</p> | |
| 148 | + <p>Your built-in admin panel is available at <a href="/admin" target="blank">/admin</a>. | |
| 149 | + <h2>Create your first API</h2> | |
| 150 | + <p>Easily generate a complete API with controllers, models and routes using:</p> | |
| 151 | + <pre><code class="lang-bash">$ strapi generate:api <apiName></code></pre> | |
| 152 | + <h2>Resources</h2> | |
| 153 | + <p>You'll probably also want to learn how to customize your application, set up security and configure your data sources.</p> | |
| 154 | + <p>For more help getting started, check out: | |
| 155 | + <ul> | |
| 156 | + <li><a href="http://strapi.io/documentation/introduction" target="blank">Documentation</a></li> | |
| 157 | + <li><a href="https://github.com/strapi/strapi" target="blank">Repository on GitHub</a></li> | |
| 158 | + <li><a href="https://twitter.com/strapijs" target="blank">news on Twitter</a></li> | |
| 159 | + <li><a href="http://slack.strapi.io" target="blank">Real-time support on Slack</a></li> | |
| 160 | + </ul> | |
| 161 | + </p> | |
| 162 | + </div> | |
| 163 | + </section> | |
| 164 | + </body> | |
| 165 | +</html> | ... | ... |
back-end/h5-api/public/robots.txt
0 → 100644
back-end/h5-api/public/uploads/.gitkeep
0 → 100644