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
2
votes
2 answers

Adonis js Where Clauses not work. this code always returned value 0

I am trying to book create a time slot and find between time in two-time value this code is always returned value 0. async store({request, auth, response}) { let {uuid, start_timestamp, end_timestamp, price} = request.all(); try { let influencer =…
Ruwan Bandara
  • 55
  • 1
  • 9
2
votes
1 answer

Adonis: How to connect with SSL (with a certificate.crt file) to MySQL?

I just created a Managed Database on Digital Ocean that requires an SSL connection. How can I do that with Adonis?
Julien Le Coupanec
  • 7,742
  • 9
  • 53
  • 67
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
  • 142
  • 2
  • 14
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
  • 7,659
  • 5
  • 40
  • 78
2
votes
1 answer

Adonisjs: how to catch exception in lucid model creation?

I'm building RESTful api with adonisjs. I face this problem in jwt login module. Look at the code below: async login({request, auth, response}) { let {email, password} = request.all() try { if (await auth.attempt(email, password)) { …
glinda93
  • 7,659
  • 5
  • 40
  • 78
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' …
Abdul
  • 1,416
  • 9
  • 26
  • 57
2
votes
0 answers

heroku give error when try to deploy adonis app

heroku give error when try to push adonis code When i am trying to deploy adonis app on heroku some of its database is upload successfully deployed but all the tables are not shown on heroku postgres database. I have five table in database but on…
IT MAIL
  • 101
  • 6
2
votes
1 answer

Adonis.js give an error when try to run adonis serve --dev command

Adonis.js give an error when try to run adonis serve --dev command This is the error when I am trying to run command in backend: balveer@balveer-HP-Laptop-15-da0xxx:~/Downloads/test/blogbackend$ adonis serve --dev SERVER STARTED > Watching files…
IT MAIL
  • 101
  • 6
2
votes
1 answer

How to deploy vuejs + adonis-api only project on heroku?

First thing i am very new in Vue, adonis and heroku. so please tell me all the steps in answer i have a project build in vuejs(frontend) and adonisjs api-only and i want to deploy this project on heroku with postgresql database. What i am done till…
IT MAIL
  • 101
  • 6
2
votes
2 answers

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
  • 13,341
  • 16
  • 97
  • 165
2
votes
1 answer

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
  • 995
  • 3
  • 11
  • 44
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…
Eleandro Duzentos
  • 1,370
  • 18
  • 36
2
votes
2 answers

Undefined result when using Axios POST

I'm try using Post method in axios to send some data, but the result of my code only undefined. This is my code to post http request using axios: const Axios = use('axios'); const Env = use('Env'); const querystring = require('querystring'); class…
chiper4
  • 303
  • 5
  • 18
2
votes
2 answers

How i can make this query using lucid models/query builder in adonis?

I need to make a query that return all book_unit_questions of one Book. So, i have the Book.Id. I'm trying something like: SELECT BO.id, BUQ.description FROM book_unit_question BUQ JOIN book_unit BU ON(BUQ.book_unit_id = BU.book_id) INNER JOIN…
bla
  • 995
  • 3
  • 11
  • 44