
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
microframework
Advanced tools
Micro framework is a bundle of express.js, mongodb ODM, validator, dependancy injection framework and restful controllers for your apps using Typescript
Micro framework is a bundle of express.js, Mongodb ODM, validator, dependancy injection framework, configuration framework and restful controllers for your apps using Typescript.
Create your main application entry point app.ts
and put there:
import {MicroFrameworkConfig} from "microframework/MicroFrameworkConfig";
import {MicroFrameworkRunner} from "microframework/MicroFrameworkRunner";
let configuration = {
express: {
bodyParser: "json"
},
odm: {
driver: "mongodb",
connection: {
url: "mongodb://localhost:27017/microframework-samples"
}
}
}; // you can also store this configuration in separate json file and require it
new MicroFrameworkRunner(__dirname, configuration)
.run()
.then(result => console.log('Express app is running. Open localhost:3000/questions'))
.catch(error => console.error('Error: ', error));
Now create your first controller in the controller/
directory. Lets call it QuestionController
:
import {Controller, Get} from "type-controllers/Annotations";
import {Response} from "express";
import {Request} from "express";
@Controller()
export class QuestionController {
@Get('/questions')
all(request: Request, response: Response): any[] {
return [
{ title: 'Which processor to choose?', text: 'Which processor is better: Core i5 or Core i7?' },
{ title: 'When new star wars gonna be released?', text: 'When star wars gonna be released? I heard in november' }
];
}
}
Now run your app and open http://localhost:3000/questions
in browser. You should see list of your questions.
Take a look on samples in ./sample
for more examples of usages.
FAQs
Microframework is a minimalistic framework you can use with TypeScript and JavaScript.
The npm package microframework receives a total of 326 weekly downloads. As such, microframework popularity was classified as not popular.
We found that microframework demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.