Questions tagged [adonis.js]

Adonis is a full stack, open source MVC framework for Node.js. The framework is inspired by the PHP framework Laravel.

AdonisJs is an MVC Framework for Node.js.

It includes:

  • Lucid ORM
  • Database Migrations
  • Authentication System
  • OAuth
  • Mailing System
  • Data Validator
  • Testing

Learn more on the website and check out the organization on Github.

739 questions
4
votes
2 answers

How to call a generator (async) function on an interval basis

I am building an app that must poll remote devices (generator fn sendRequests()) every 2 seconds. What's the right way to call the generator fn using setInterval, which isn't a generator and doesn't yield function * sendRequests() { // multiple…
Tremendus Apps
  • 1,497
  • 12
  • 20
3
votes
1 answer

Is there a way to squash migrations or baseline a database in Adonis Lucid?

I would like a way to generate migrations programmatically from an existing database in the Adonis ecosystem. Having to run 500 migrations, for example, during every test run is annoying and takes time, and I would like to squash migrations up to a…
Jordan Nelson
  • 453
  • 6
  • 17
3
votes
1 answer

How to give a unique constraint in lucid model, I am using lucid in adonis with typescript

In adonis.js i am trying to add a unique constraint to email field just like we do it in sequelize,prismajs or any other orm.Is it posible to add in adonis. import { DateTime } from 'luxon' import { BaseModel, column, computed, HasMany,…
Mradul Jain
  • 62
  • 12
3
votes
3 answers

how to create a path and query validation in adonis5

In adonis5 i am currently using schema based validation, but these validation is only applicable to request body . how i can validate path and query parameter validation import { rules, schema } from '@ioc:Adonis/Core/Validator' import {…
3
votes
0 answers

How to subscribe to an adonisjs web socket channel in gdscript?

I'm trying to combine adonisjs(v4.1) websocket with gdscript. And that means that I need to connect to adonisjs from godot by gdscript code. Now the more clear question is "because adonisjs socket is running on a channel, how to subscribe to the…
Mahmood
  • 403
  • 2
  • 10
3
votes
1 answer

Adonis 5.0 TypeError: Cannot read property 'length' of undefined

I am trying to setup lucid on adonis 5.0 after installation using node ace invoke @adonisjs/lucid OS: windows 10 node version: 14.6.1 npx version: 6.14.12 Expected Result --Set up lucid Actual Result TypeError: Cannot read property 'length' of…
3
votes
3 answers

File Storage (S3) with AdonisJS 5

In AdonisJS v4 docs we have this section explaining how to stream files to a S3 bucket. I was looking for something similar in AdonisJS v5 docs but it have just an example of how to upload files to local server. If it is not ready yet since Adonis 5…
tomrlh
  • 1,006
  • 1
  • 18
  • 39
3
votes
1 answer

How i can use whereHas in adonis?

I'm trying to make a query that return the quizzes of one class only if execution_back_status is equal to "Enviado Perguntas". But i'm receiving records different of "Enviado Perguntas" What i try: let quizAbertos = await Class.query() …
bla
  • 995
  • 3
  • 11
  • 44
3
votes
2 answers

AdonisJs - Custom JWT uid field key

I have built an API using Laravel, with Laravel Passport. Everything works great, but what I'm trying to achive now, is to build a new API using AdonisJs - for a few smaller things for the website but have the authentication same for both…
3
votes
1 answer

How i can make custom validators in adonis /node.js?

Actually i have one function store(){} in my controller that make several validations, this validations return response status specific, i'm thinking if exist one way that i can import this validations and test before the create() method. Actually…
bla
  • 995
  • 3
  • 11
  • 44
3
votes
2 answers

AdonisJS - Cannot call function csrfField

When I use {{ csrfField() }} in my edge template, I get the error Cannot call function csrfField from user/payments/pay/unpaidHours.edge view Here is my view
PrestonDocks
  • 4,851
  • 9
  • 47
  • 82
3
votes
1 answer

How to update the junction table with user's role in Adonis

I have a database with three tables: users, games and game_user. usersand games have a many to many relationship with game_user as its junction table The table game_user has only three columns (other than id): game_id, user_id and game_admin. The…
3
votes
3 answers

How to use React.js with AdonisJs

How can I use React.js in the front-end of my AdonisJs project? I've tried to install react with npm install react I thought this will works correctly. I made a file app.js with this code: var React = require('react'); var ReactDOM =…
Ayech Hamza
  • 159
  • 2
  • 10
3
votes
0 answers

"The iterator does not provide a 'throw' method." in Foreach node.js

I'm having trouble with nodejs generators, when I launch my code I got the following error : node:3632) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: The iterator does not provide a 'throw'…
Romain Kraft
  • 83
  • 1
  • 5
2
votes
1 answer

Error when using BootStrap 5 with Adonis and Inertia, with scss support

Error when using BootStrap with Adonis and Inertia, with scss support. I've been trying for days to make it work and I can't. Below is the configuration. Would anyone know how I can resolve this issue? Grateful for the…
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
1 2
3
49 50