
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
microframework
Advanced tools
Micro framework is a bundle of express.js, mongodb ODM, dependancy injection framework and restful controllers for your apps using Typescript
Micro framework is a bundle of express.js, Mongodb ODM, dependancy injection 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 349 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.