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.

572 questions
2
votes
1 answer

JWT token not saved on database

A user's authentication returns the token, but it is not saved in the database AuthController: 'use strict' const User = use("App/Models/User"); class AuthController { async registrar({ request }) { const data = request.only(["username",…
di0n
  • 25
  • 7
2
votes
1 answer
2
votes
3 answers

Adonis JS Primary key value is missing for user

I'm trying to make a migratiion of users model from adonis to postgres but I keep getting this error Primary key value is missing for user My model look like this: class User extends Model { static boot () { super.boot() …
2
votes
1 answer

AdonisJS unable to return response within a function (SAP HANA)

I am using SAP HANA CLIENT for NodeJS in my AdonisJS project. I am unable to return the response as json from the the function that connects to the database. Here is the code The controller method validateInvoice is first called async…
Ashik Basheer
  • 1,282
  • 3
  • 13
  • 31
2
votes
2 answers

Error: Cannot find module 'phc-argon2' Adonis Js

Hi everybody I try use hash in password model but if i try save a new user adonis send me this error : Error: Cannot find module 'phc-argon2' I find in official documentation of adonis but i not found some solution... this is my model : import {…
Gario3
  • 69
  • 8
2
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
  • 667
  • 4
  • 19
2
votes
2 answers

Return view in controller AdonisJS

How can I return a view and display it through the controller in AdonisJs 'use strict' class PostController { index(){ return view.render('welcome') } } module.exports = PostController report this error: ReferenceError view is not…
RafaelB13
  • 93
  • 6
2
votes
1 answer

MongoDB 40415: BSON field 'create.bsonType' is an unknown field

I am trying to create a collection with validator in MongoDB and faced a strange error. This is what I'm trying to do in controller: import { orderValidator } from 'db/validator' await db.createCollection('orders',…
glinda93
  • 3,643
  • 2
  • 16
  • 39
2
votes
1 answer

TypeError: instance[method].bind is not a function AdonisJs

I am integrating MQTT-adonis module adonis-mqtt respo on git here in adonis-js application while serving it throws an exception TypeError: instance[method].bind is not a function Can any one guide why this is appearing. //event.js 'use strict' …
trighati
  • 1,176
  • 7
  • 19
  • 49
2
votes
1 answer

Yarn global install: "adonis: command not found"

Installed Adonis with yarn on Ubuntu 18 (running on WSL2 VM): pomatti@NT-03024:~/Projects/myApp$ yarn global add @adonisjs/cli yarn global v1.19.1 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.9: The platform "linux" is…
Evandro Pomatti
  • 7,960
  • 11
  • 56
  • 111
2
votes
0 answers

How i can make a distinct in leftJoin using adonis/node.js?

I'm trying to make a distinct in a leftJoin, but the .distinct() seems not work for my context. I have this query: const questions = Database .query() .select('book_unit_question.*') …
bla
  • 667
  • 4
  • 19
2
votes
1 answer

AdonisJS app deployment on AWS ElasticBeanstalk using AWS CodePipeline fails - missing .env

I've recently started using AdonisJS for API development. I'm using AWS Elastic Beanstalk together with AWS CodeCommit and AWS CodePipeline to deploy new code on each git push. Since .env file is not present in git repository, I've added env…
2
votes
2 answers

How can I automatically append a property from a relation to the root object?

How can I automatically append a property from a relation to the root object, as if it were a column from the same table but actually it is coming from another table. Supose I have an User model that hasMany Emails. How can I only append the email…
e200
  • 668
  • 6
  • 22
2
votes
1 answer

There's a way to export the result of the unit test in visual studio code?

I have this test in adonis.js - node.js: test('realiza login com o usuário registrado', async ({ client }) => { const response = await client .post('login') .send({ username: 'usuarioteste', password: 'usuarioteste' }) …
bla
  • 667
  • 4
  • 19
2
votes
1 answer

AdonisJS Error Code "EBADCSRFTOKEN" in Postman in PUT,POST,DELETE operation

I have created REST API in AdoniJs. In this I have created API endpoints for CRUD operations with GET, POST, PUT and DELETE menthods. I am using shieldjs as a middleware to verify CSRF token. I am making API calls from Postman. Firstly I am calling…
Kumar Sanu
  • 108
  • 9
1 2
3
38 39