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

How to validate schema date on adonis js?

I have a schema like this: judul: schema.string(), ringkasan: schema.string(), tahun_terbit: schema.date({ format: 'yyyy-MM-dd' }), halaman: schema.number(), kategori_id: schema.number([rules.exists({ table:…
Badrudin
  • 31
  • 3
2
votes
3 answers

Adonis 5 how to get pivot_column from $extras and inject into preload

I created an extra column on my manyToMany decorator and know how to preload my data based on its value. my question is how can I actually take that value and insert it to it's relevant preloaded data or insert them into a new array on parent model,…
w3bsite
  • 181
  • 1
  • 10
2
votes
1 answer

Access Denied after interactionFinished using node-oidc-provider

I'm using node-oidc-provider in a custom framework, adonisjs to be specific. At this point, I can visit http://localhost:3333/auth?client_id=foo&redirect_uri=http://localhost:3333/launch&response_type=code&scope=openid&nonce=123&state=321 and be…
2
votes
0 answers

How can I solve [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379?

I want to run a project with adonis 4.1 in my local. So I run adonis serve --dev It show : SERVER STARTED > Watching files for changes... info: serving app on http://127.0.0.1:3333 If http://127.0.0.1:3333 called, there exist error like this…
2
votes
1 answer

How can I solve source.on is not a function when using form data?

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) { …
2
votes
0 answers

how can i use adonis.js with GraphQL?

how can i use adonis with GraphQL? i had search much more Tutorial but never,so i have to ask for help to you i had create schema.ts in project like this : import { makeExecutableSchema } from 'graphql-tools' import resolvers from './resolvers' //…
邱彦兮
  • 21
  • 1
2
votes
0 answers

Get Ioc binded object at Adonis v5

I use ioc.bind and ioc.use at adonis v4, and now at adonis v5, how do I use ioc.use? I want to reuse the instance Container/MerchantService and get the base url or call the function inside Container/MerchantService I try to find it in adonis…
2
votes
1 answer

How to use Hash.make(user.password) in adonisjs

Trying to encrypt a user password using Hash.make(user.password) from import Hash from '@ioc:Adonis/Core/Hash' The problem happens when the code tries to execute the Hash.make present inside @beforesave it gives me a referenceError. message:'Hash is…
Cesarvspr
  • 301
  • 3
  • 9
2
votes
0 answers

Setting Tesseract.js data location

I built a server with Adonis.js and Typescript that downloads an image from the web and performs OCD on it with Tesseract.js. The program works, but every time a new Tesseract worker gets initialized this error shows up: The eng.traineddata is…
exakoss
  • 55
  • 1
  • 6
2
votes
1 answer

AdonisJs - Cannot find module

In AdonisJS I created a controller with core command node ace make:controller TodoController, but I am getting this Cannot find module Creating Controller: node ace make:controller TodoController Routes.ts: import Route from…
forig Men
  • 21
  • 2
2
votes
0 answers

Proxy Error: Could not proxy request /api/admin/login from localhost:8080 to http://127.0.0.1:3333 (ECONNRESET) with Vuejs

I am trying to make call from vuejs project to adonis js using proxy. My vue.config.js file is as bellow: devServer: { proxy: { '^/api': { target: 'http://127.0.0.1:3333', secure: false, …
azam
  • 53
  • 3
2
votes
1 answer

How can I start scheduler with starting adonis server

I want to run the scheduler along with the server startup in adonis js. I want to schedule task but don't want to execute it with external command like adonis run:scheduler or node ace run:scheduler Is there any other way to do so?
2
votes
2 answers

How to get separated auth for admin and user models in Adonis JS

Is it possible to have separated Auth for different models in Adonis Js? I have two different table for admins and users and want to have separated Auth. How can I setup this in adonis js ?
Biswa
  • 479
  • 7
  • 11
2
votes
1 answer

Adonisjs 5.0 TypeError: this.container.singleton is not a function

I just installed the adonis5-scheduler on adonisjs5 and I am getting an error anytime I try to serve OS: windows 10 node version: 14.6.1 npx version: 6.14.12 Expected result --Build Serve Actual result TypeError: this.container.singleton is not a…
Ubani Uche
  • 51
  • 5
2
votes
2 answers

How can I solve a crash in an Adonis app starting?

this is my first question ever. I'm trying to run an Adonis.js app by entering adonis serve --dev at the terminal. The messages are always the same in this succession: SERVER STARTED Watching files for changes... Fatal error in , line 0 Check…