Nicola Krumschmidt
3d0e086c55
Rework hook registration ( #8027 )
...
* Rework hook registration
* Remove event and action fields from hook payloads
* Move "error" action to "request.error" filter
* Emit meta and context objects in filters and actions
* Run filters sequentially
* Update hook templates
* Fix CLI hook test
* Also emit `<collection>.items.crud` when emitting `items.crud`.
* Update hook docs
Co-authored-by: Oreilles <oreilles.github@nitoref.io >
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com >
2021-11-03 17:18:56 -04:00
rijkvanzanten
9b210ed597
Move startServer to server.ts
2021-09-13 17:48:36 -04:00
Nicola Krumschmidt
7d8aa9fced
Replace DIRECTUS_DEV env var with NODE_ENV and SERVE_APP ( #6929 )
2021-07-22 23:47:56 +02:00
Rijk van Zanten
77e00b7db4
Don't initialize database on file require ( #6003 )
2021-06-02 11:41:42 -04:00
rijkvanzanten
801e868554
Fix remaining eslint errors
...
h/t @paescuj
2021-04-29 15:55:12 -04:00
Pascal Jufer
acd41eb0be
Syntax fixes ( #5367 )
...
* Declare return types on functions
And a very few other type related minor fixes
* Minor syntax fixes
* Remove unnecessary escape chars in regexes
* Remove unnecessary awaits
* Replace deprecated req.connection with req.socket
* Replace deprecated upload with uploadOne
* Remove unnecessary eslint-disable-next-line comments
* Comment empty functions / catch or finally clauses
* Fix irregular whitespaces
* Add missing returns (null)
* Remove unreachable code
* A few logical fixes
* Remove / Handle non-null assertions which are certainly unnecessary (e.g. in
tests)
2021-04-29 12:11:43 -04:00
rijkvanzanten
b629bf61d0
Rely on url.parse for path extraction
...
Doesn't break on illegal URLs
2021-04-21 09:41:53 -04:00
WoLfulus
b8e7c80b72
Application initialization events ( #3680 )
...
* Adds `not_found` hook
* Separate hooks and endpoints initialization process
* Adds additional application events
* Remove unused import
* Change the event order to accound for notFound and errorHandler
* Change emitAsync.catch to use the emitAsyncSafe function
* Updated docs, reordered table by lifecycle and usage
2021-02-08 12:30:09 -05:00
WoLfulus
7f3e095a1f
Enable base and admin routes when developing a Directus app
2020-12-17 11:42:50 -03:00
Igor Savin
7cddb458cb
Run prettier across app and api
2020-12-08 02:22:00 +02:00
rijkvanzanten
83971d9bc6
Make app / server creation async
...
Fixes #690
2020-10-19 16:38:15 -04:00
rijkvanzanten
a0d909f7d9
Cleanup server file a bit
2020-10-19 16:21:38 -04:00
WoLfulus
4662ede22f
Adds separate path and host
2020-10-17 13:43:21 -03:00
WoLfulus
13285ff522
Added response events to the server
2020-10-17 13:26:24 -03:00
rijkvanzanten
0b894138b7
Move start to separate file
2020-10-15 12:44:21 -04:00
rijkvanzanten
0e0d5e8213
Start server when running file directly with Node
2020-10-15 12:34:57 -04:00
rijkvanzanten
a39b762c81
Move start functionality to server.ts
2020-10-15 12:31:57 -04:00
rijkvanzanten
a4092a070d
Add server.start / server.start.before / server.stop / server.stop.before
2020-10-15 12:19:14 -04:00
rijkvanzanten
cc950b5510
Move main server logic out of cli
2020-10-15 12:15:37 -04:00
rijkvanzanten
23458b5b9f
Last port change, promise
2020-10-02 16:26:40 -04:00
rijkvanzanten
1524c3e398
Change default port to 8805
2020-10-02 14:56:39 -04:00
rijkvanzanten
a67b338f09
Don't validate env in server
2020-09-08 14:57:21 -04:00
rijkvanzanten
bc4b493ff9
Do checks before starting server
2020-08-04 13:21:51 -04:00
rijkvanzanten
2252d5a35f
Use centralized env export with validator function
2020-08-04 13:10:49 -04:00
rijkvanzanten
a0306b1b8a
Force api to dev port on development mode
2020-08-03 18:10:37 -04:00
rijkvanzanten
a99a7f47f4
Use port 41201 instead of 3000 by default
2020-08-03 17:44:09 -04:00
rijkvanzanten
bde7069cce
Move api into api subdirectory
2020-07-29 11:22:56 -04:00