savory / danet-starter Goto Github PK
View Code? Open in Web Editor NEWA basic Danet app to help you build awesome API
License: MIT License
A basic Danet app to help you build awesome API
License: MIT License
I'm using
deno 1.26.0 (release, x86_64-unknown-linux-gnu)
v8 10.7.193.3
typescript 4.8.3
, I run deno task test, I get the following
deno task test
Warning deno task is unstable and may drastically change in the future
Task test NO_LOG=true deno test --allow-env --allow-net --allow-read -A --unstable spec
Check file:///home/ely/Documents/test-and-learn/Danet-Starter-main/spec/todo.test.ts
error: TS2740 [ERROR]: Type 'Promise<TodoService>' is missing the following properties from type 'TodoService': todos, getAll, getById, create, and 3 more.
todoService = app.get<TodoService>(TodoService) ;
~~~~~~~~~~~
at file:///home/ely/Documents/test-and-learn/Danet-Starter-main/spec/todo.test.ts:32:5
I try add "await" like this
:
todoService = await app.get<TodoService>(TodoService) ;
I fix the syntaxe error the test still fail, in fact the todoService still undefind after this
todoService = await app.get<TodoService>(TodoService) ;
more clean in Danet Starter ( deps readibility )
in most time we compare Danet Starter with Nestjs project, in Nest proeject whem we read :
import {POST} from 'nestjs/common'
we understand that POST function belong to 'nestjs/common' module
but when read :
import { POST } from 'dep.ts'
we can't be sure that POST function is in danet module befor reading deps.ts content
(may be the example is not expressive but you can understand what I mean)
SUGGESTION:
I suggess that deps should be stored in forld (deps) instead of file (deps.ts), in actual Danet Starter, deps folder structure shoud be something like :
├── deps
│ ├── danet.ts
│ ├── mongo.ts
│ └── postgres.ts
the content of each file trivial (I think)
or maybe :
├── deps
│ └── deno.land
│ └── x
│ ├── danet.ts
│ ├── mongo.ts
│ └── postgres.ts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.