Compare commits

..

No commits in common. "ad11b7abec493d617e2d7e546b68ff44aa2484e5" and "1ffe22be10b1542708423adf8898a6265a8048fc" have entirely different histories.

10 changed files with 15 additions and 75 deletions

6
.gitignore vendored
View File

@ -9,8 +9,4 @@ tmp
.env
# The development sqlite file
database/*.sqlite
# VSCode & Webstorm history directories
.history
.idea
database/development.sqlite

View File

@ -1,17 +0,0 @@
'use strict'
class ConvertEmptyStringsToNull {
async handle ({ request }, next) {
if (Object.keys(request.body).length) {
request.body = Object.assign(
...Object.keys(request.body).map(key => ({
[key]: request.body[key] !== '' ? request.body[key] : null
}))
)
}
await next()
}
}
module.exports = ConvertEmptyStringsToNull

View File

@ -1,16 +0,0 @@
'use strict'
class NoTimestamp {
register (Model) {
Object.defineProperties(Model, {
createdAtColumn: {
get: () => null,
},
updatedAtColumn: {
get: () => null,
},
})
}
}
module.exports = NoTimestamp

View File

@ -10,7 +10,7 @@ module.exports = {
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application and can be used when you
| This value is the name of your application and can used when you
| need to place the application's name in a email, view or
| other location.
|
@ -35,7 +35,7 @@ module.exports = {
| Allow Method Spoofing
|--------------------------------------------------------------------------
|
| Method spoofing allows you to make requests by spoofing the http verb.
| Method spoofing allows to make requests by spoofing the http verb.
| Which means you can make a GET request but instruct the server to
| treat as a POST or PUT request. If you want this feature, set the
| below value to true.
@ -48,10 +48,10 @@ module.exports = {
| Trust Proxy
|--------------------------------------------------------------------------
|
| Trust proxy defines whether X-Forwarded-* headers should be trusted or not.
| Trust proxy defines whether X-Forwaded-* headers should be trusted or not.
| When your application is behind a proxy server like nginx, these values
| are set automatically and should be trusted. Apart from setting it
| to true or false Adonis supports a handful of ways to allow proxy
| to true or false Adonis supports handful or ways to allow proxy
| values. Read documentation for that.
|
*/
@ -62,7 +62,7 @@ module.exports = {
| Subdomains
|--------------------------------------------------------------------------
|
| Offset to be used for returning subdomains for a given request. For
| Offset to be used for returning subdomains for a given request.For
| majority of applications it will be 2, until you have nested
| sudomains.
| cheatsheet.adonisjs.com - offset - 2
@ -88,7 +88,7 @@ module.exports = {
| Etag
|--------------------------------------------------------------------------
|
| Set etag on all HTTP responses. In order to disable for selected routes,
| Set etag on all HTTP response. In order to disable for selected routes,
| you can call the `response.send` with an options object as follows.
|
| response.send('Hello', { ignoreEtag: true })
@ -116,9 +116,9 @@ module.exports = {
| Dot Files
|--------------------------------------------------------------------------
|
| Define how to treat dot files when trying to serve static resources.
| Define how to treat dot files when trying to server static resources.
| By default it is set to ignore, which will pretend that dotfiles
| do not exist.
| does not exists.
|
| Can be one of the following
| ignore, deny, allow

View File

@ -91,11 +91,5 @@ module.exports = {
| the redis file. But you are free to define an object here too.
|
*/
redis: {
host: '127.0.0.1',
port: 6379,
password: null,
db: 0,
keyPrefix: ''
}
redis: 'self::redis.local'
}

View File

@ -18,7 +18,7 @@
"dependencies": {
"@adonisjs/ace": "^5.0.8",
"@adonisjs/auth": "^3.0.7",
"@adonisjs/bodyparser": "~2.0.9",
"@adonisjs/bodyparser": "^2.0.5",
"@adonisjs/cors": "^1.0.7",
"@adonisjs/fold": "^4.0.9",
"@adonisjs/framework": "^5.0.9",

View File

@ -67,16 +67,6 @@ section:before {
animation: slideUp 1s cubic-bezier(0.19, 1, 0.30, 1) 0.5s forwards;
}
a {
color: inherit;
text-decoration: underline;
}
p {
margin: 0.83rem 0;
}
@keyframes slideUp {
0% {
transform: translateY(40px);

View File

@ -9,12 +9,7 @@
<section>
<div class="logo"></div>
<div class="title"></div>
<div class="subtitle">
<p>AdonisJs simplicity will make you feel confident about your code</p>
<p>
Don't know where to start? Read the <a href="https://adonisjs.com/docs">documentation</a>.
</p>
</div>
<div class="subtitle"><p>AdonisJs simplicity will make you feel confident about your code</p></div>
</section>
</body>
</html>

View File

@ -16,8 +16,7 @@ const globalMiddleware = [
'Adonis/Middleware/BodyParser',
'Adonis/Middleware/Session',
'Adonis/Middleware/Shield',
'Adonis/Middleware/AuthInit',
'App/Middleware/ConvertEmptyStringsToNull',
'Adonis/Middleware/AuthInit'
]
/*
@ -38,8 +37,7 @@ const globalMiddleware = [
|
*/
const namedMiddleware = {
auth: 'Adonis/Middleware/Auth',
guest: 'Adonis/Middleware/AllowGuestOnly'
auth: 'Adonis/Middleware/Auth'
}
/*

View File

@ -13,7 +13,7 @@
|
*/
/** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */
/** @type {typeof import('@adonisjs/framework/src/Route/Manager'} */
const Route = use('Route')
Route.on('/').render('welcome')