Comments (3)
Maybe we can add a new class decorator and a column type: 'fixed'.
exp:
@Auth({
method: 'POST',
url: '/login',
})
class User {
@Column({
type: 'fixed',
value: 'admin'
})
username: string;
@Column({
type: 'fixed',
value: 'adminpassword'
})
password: string;
}
from parrot.
Maybe we can have something like this if is possible to handle with the Decorators, (maybe need a new meta data class)
@Route({
url: '/login',
})
class AuthLogin {
@Request('get')
request({username, password}) { // from the params object
if(username === 'admin' && password) {
retrurn this.response({token: 'xxxx'});
} else {
retrurn this.response({error: 'Username or password are wrong'});
}
}
@Respose('JSON')
respose(data) {
return {
...data,
info: {
log_time: Date.now(),
}
}
}
}
from parrot.
Great!
I will implement a standard config for auth server first.
from parrot.
Related Issues (16)
- rewrite type decorators
- implement post put and delete request methods
- pack and publish to npm HOT 2
- test case: utils
- test case: decorators
- test case: Entity
- test case: relations
- test case: storage
- test case: DataBase
- test case: middleware
- consider: add id field declaration in @Entity HOT 3
- rename project to parrot
- Using config.outDir Instead of config.include
- add type validation in post/put/patch request
- add new Column Type: image, date, name, address, url, fixed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parrot.