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

Registering 3rd party package provider in Adonis js 5

We could register 3rd party package providers in providers array of start/app.js in Adonis v4. Here's how we use 3rd party package in v4 But I can't find app.js file under start folder in v5. How can I register then?
1
vote
0 answers

Flutter/Adonis server and Google auth

I have API server written with Adonis JS (it handles REST calls, auth, contain DB). When user login/register successful server return opaque access token. I need to create Flutter App and it should use existing server. Also i need to add social…
VCh
  • 11
  • 1
1
vote
1 answer

Multiple statements on a single query with Adonisjs

I'd like to pass a several statements on a single line query. It's possible? const sql = 'update table set column where id = ?; delete from table where id = ? delete from table where id = ? select * from table…
1
vote
1 answer

Validate post sub item in AdonisJs

Validate post sub item in AdonisJs. I can't validate a sub item of the post. I believe it is not found. I need to validate "codigo" that is inside "nfe" Request { nfe: { codigo: '56456', motorista: 'NOME', contato: 'CONTATO', casa:…
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
1
vote
1 answer

Cannot read properties of undefined (reading 'singleton') - Adonisjs

An error occurs when tender registers a singleton-type Service. I'm using IocContract AppProvider export default class AppProvider { constructor( protected app: ApplicationContract, protected $container: IocContract ) {} public…
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
1
vote
1 answer

Adonis migration to drop unique constraint

I am working on an Adonis JS project. I want to do the equivalent of ALTER TABLE products DROP CONSTRAINT unique_col_id where the unique_col_id is responsible for products.sku to be unique. I tried this in AdonisJS…
John
  • 32,403
  • 80
  • 251
  • 422
1
vote
3 answers

Opening Mongoose connection in AdonisJS provider times out

I was following this article to use Mongo in AdonisJS 5 project. I have an AdonisJS provider which I have created by node ace make:provider Mongo (it is registered in .adonisrc.json): import { ApplicationContract } from…
o..o
  • 1,789
  • 5
  • 31
  • 59
1
vote
3 answers

AdonisJs Ace - E_IOC_LOOKUP_FAILED

I'm trying to load the Event system into an ace command. public async run() { const { default: Event } = await import('@ioc:Adonis/Core/Event') } However this results in the following error: Cannot resolve "Adonis/Core/Event" namespace from the…
Ricky Barnett
  • 1,130
  • 3
  • 15
  • 32
1
vote
1 answer

Why is the service not injected into the controller?

I'm trying out AdonisJS, but I'm stuck trying to get a service injected into a controller. No matter what I try, the hs constructor argument in VersionsController remains undefined. I've also experimented with annotating the VersionController…
sbrattla
  • 5,274
  • 3
  • 39
  • 63
1
vote
0 answers

Best way to social authenticate a Vue-cli SPA with AdonisJS on de backend

I'm a huge fan of Vue and I recently discovered AdonisJs and since I come from Laravel I instantly fallen in love with it. That being said I was trying to start a project where I could login with github (or google or facebook...) in the SPA and then…
1
vote
1 answer

How to upload a file?

I have been trying to upload a simple image using adonisjs and the request.file() keeps on returning null. I am pretty new to adonisjs and the documentation is not clear on what to do. I am using a SQLite database. This is my controller. public…
DMcC406
  • 15
  • 2
1
vote
0 answers

Adonis V5 Lucid - Conditional Query

In the following code I'd like to filter according to received filters. The thing is that each of the filters can be defined or not. I'm getting a error inside the Lucid If statements because filters.status and filters.departments can be undefined.…
yuridamata
  • 459
  • 1
  • 5
  • 13
1
vote
2 answers

Why does google app engine seem to use old code?

I've setup Google App Engine to run my AdonisJS API for my website. I update the code using the CLI for google cloud services ("gcloud app deploy"). I get a success message from the terminal, and I have checked both the cloud build and version…
1
vote
1 answer

AdonisJS 5, dynamically connect database

Hi used Adonis Js 5 with the new version. I have multiple database clients with the same database structure, can I create a new database connection without declaring the config at config/database.ts? it means I can create a connection on the fly.
1
vote
0 answers

Is it possible to access the ctx context in @beforeSave Adonis 5?

How could I do something like that? @beforeSave() public static async audit(model: Model) { console.log(ctx.auth.user) await Audit.create({ model, ctx.auth.user }) }