tsconfig fix + updated README.md
parent
9af57a4e49
commit
28133e7c1c
@ -1,2 +1,33 @@
|
||||
# Resize-Api
|
||||
|
||||
The resize API allow to place images into your frontend with the size set via URL parameters for rapid prototyping
|
||||
|
||||
A library to serve properly scaled versions of your images to the front end to reduce page load size
|
||||
|
||||
|
||||
# Installation
|
||||
|
||||
1- Install packages dependencies
|
||||
`npm install`
|
||||
|
||||
2- build the project
|
||||
`npm build`
|
||||
|
||||
3- run the node server
|
||||
`node ./build/index`
|
||||
|
||||
You can also run the code through the nodemon devepement server
|
||||
`npm run start`
|
||||
|
||||
When the server is running, you can resize an image by going to this url and adding parameters to resize the image `http://localhost:5000/api/image?filename=encenadaport&width=200&height=200`
|
||||
|
||||
# Built with
|
||||
|
||||
- Typescript
|
||||
- Node
|
||||
- Sharp module to resize the image
|
||||
- Express
|
||||
- Git
|
||||
|
||||
# Author
|
||||
Anis Benziane
|
||||
|
@ -1 +0,0 @@
|
||||
"use strict";
|
@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const express_1 = __importDefault(require("express"));
|
||||
const app = (0, express_1.default)();
|
||||
const port = 3000;
|
||||
function myFunc(num) {
|
||||
return num * num;
|
||||
}
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World' + myFunc(5));
|
||||
});
|
||||
app.get('/api', (req, res) => {
|
||||
res.send('welcome to api');
|
||||
});
|
||||
// start Express server
|
||||
app.listen(port, () => {
|
||||
console.log(`server started at http://localhost:${port}`);
|
||||
});
|
||||
exports.default = {
|
||||
myFunc
|
||||
};
|
@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const jasmine_spec_reporter_1 = require("jasmine-spec-reporter");
|
||||
class CustomProcessor extends jasmine_spec_reporter_1.DisplayProcessor {
|
||||
displayJasmineStarted(info, log) {
|
||||
return `TypeScript ${log}`;
|
||||
}
|
||||
}
|
||||
jasmine.getEnv().clearReporters();
|
||||
jasmine.getEnv().addReporter(new jasmine_spec_reporter_1.SpecReporter({
|
||||
spec: {
|
||||
displayStacktrace: jasmine_spec_reporter_1.StacktraceOption.NONE
|
||||
},
|
||||
customProcessors: [CustomProcessor],
|
||||
}));
|
@ -1,9 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const index_1 = __importDefault(require("../index"));
|
||||
it('expect myFunc(5) to equal 25', () => {
|
||||
expect((0, index_1.default)(5)).toEqual(25);
|
||||
});
|
Loading…
Reference in New Issue