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
1
vote
0 answers

AdonisJs Lucid ORM subquery as column for client-side sort

I am wanting to move the ORDER BY part of my AdonisJs query into a column as a number so that when it's stored on the client-side in a Vuex store I have a "Ranking" for ordering. let posts = Post.query().where('processed', 1) posts = posts …
Michael Smith
  • 625
  • 1
  • 8
  • 19
1
vote
2 answers

Error when make a controller on AdonisJS5

When I try to run the command node ace make:controller User displays the following error Cannot find module './commands/Make\Controller' Require stack: /Users/abiliocoelho/Desktop/socket/node_modules/@adonisjs/assembler/build/noop.js 1 …
1
vote
0 answers

How to implement a custom auth guard for Firebase in Adonis.js?

I'm new to Adonis.js and have came across an issue when extending the official auth package. My application has requirements for two auth methods for different user types, one being email + password with tokens as the transport (easy enough), the…
Adam Galloway
  • 71
  • 1
  • 5
1
vote
0 answers

How can I convert the uploaded file to buffer?

My code like this : const axios = require('axios').default import FormData from 'form-data' import fs from 'fs' export default class MyController { public async handleMultipleFile({ request }: HttpContextContract) { …
1
vote
1 answer

Web socket.io with AdonisJs not working properly

Web socket.io with AdonisJs not working properly. I'm using a lib to perform tasks inside adonis, adonis5-scheduler. Below is my task. import { BaseTask } from 'adonis5-scheduler/build' export default class GetRouletteGame extends BaseTask { …
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
1
vote
1 answer

How to setup a Adonis js app in CyberPanel

I’m having trouble loading the application. When accessing the subdomain an infinite load is shown and nothing happens. I tried to use several available tutorials and still without success SSL work Migration Work See below I’m use AdonisJs context…
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
1
vote
1 answer

AdonisJS : Can't send email via @adonisjs/mail

I use adonis js version 4.1.0 and @adonisjs/mail version ^3.0.10. I'm not sure why. But I'm sure my email and password are correct which previously email can be used normally. Please help me. Thank for your solution. I got this error when I send…
atjab
  • 127
  • 2
  • 16
1
vote
0 answers

AdonisJS 5 Dockerfile - Cannot find ace

I have a docker setup with AdonisJS 5. I'm currently trying to get it started (and it builds just fine). But as discussed a bit further down, the ace command cannot be found. ace is the CLI package for AdonisJS (think ng for Angular) This is my…
1
vote
1 answer

AdonisJS - Cannot find module 'fs/promises'

I had a problem creating an AdonisJS project due to the next error when I try to run the command npm init adonis-ts-app@latest hello-world: internal/modules/cjs/loader.js:818 throw err; ^ Error: Cannot find module 'fs/promises'
CrgioPeca88
  • 973
  • 7
  • 12
1
vote
1 answer

Adonis 5 + Vue "E_ROUTE_NOT_FOUND"

I'm doing an Adonis v5 app with Vue 2 as frontend. My problem is, once I've build Vue frontend into public adonis folder. If I access to a speficic route writing it into the top browser searcher, I get the E_ROUTE_NOT_FOUND from Adonis. I do think…
Pau
  • 21
  • 5
1
vote
0 answers

why adonis object stored in static file getting changed on doing operation on its imported value?

I am using adonis framework for server. I am storing an array of object in a file and using it in my code as datasource but when I am running a manipulation on imported variable of this array of object, it changes the value of that object for that…
1
vote
1 answer

How do I rollback adonisjs database before running functional tests with japa?

I set up my bootstrap file to run a few TestUtil commands so that I can migrate and seed my test database before running my full functional test suite. The problem that I'm running in to is when my seeder for creating Admin user runs it fails…
mattwallace
  • 4,132
  • 6
  • 43
  • 77
1
vote
0 answers

How to implement Server Sent Events (SSE) in AdonisJS

how to implement SSE in adonisjs I have an application and I'm having trouble implementing Server Sent Events (SSE) in AdonisJs. I can initiate the connection and send messages, but I don't know where and how to store the list of connected users. I…
1
vote
1 answer

How to use mocks in tests with Adonis 5 (adonisjs/fold package)?

I have an API built with Adonis 5 (core version 5.4.0). The tests are made with Adonis' own runner, japa (version 3.1.1). As per the Adonis documentation, I build my tests to interact with a real test database without mocks. However, we implemented…
Ernani
  • 319
  • 1
  • 4
  • 18
1
vote
2 answers

How do I get a refreshToken with adonisJS v5?

In versions prior to 5, it used: await auth.withRefreshToken().generate(user) Is there something I can do similar in adonisJS version 5?
Enio
  • 11
  • 1