Hi, I create a npm package that contains several utils for my project, one of the util is a patch to another npm package. Now, I don't know how to export and import the patch in order to use inside one of my projects. This is the example of the patch. file name: patch.ts inside my custom_npm_package
declare module 'node/module/to/patch' {
interface Manager {
saveOne<Entity>(entities: Entity, options?: SaveOptions): Promise<Entity>
}
}
Manager.prototype.saveOne = function <Entity>(
entity: Entity,
options?: SaveOptions,
): Promise<Entity> {
console.log('do things')
return this.save(entity, options)
}
When this patch is inside the project I want to use it, it's working, I can call to saveOne method.
is there anyone who was deploy a node.js web application on heroku successfully?
I tried multiple times (with heroku CLI and connect to GitHub), I also removed the buildpack and add it again but no difference. Heroku seems could not deploy it successfully. would you like to help me?
This is the GitHub Repo: https://github.com/nodejsdeveloperskh/passport-lookup
and this is the Heroku log:
timestamp app[api]: Build started by user X
timestamp app[api]: Release v3 created by user X
timestamp app[api]: Deploy ecba21a1 by user X
timestamp app[api]: Scaled to web@1:Free by user X
timestamp app[api]: Build succeeded
timestamp heroku[web.1]: Starting process with command `npm start`
timestamp app[web.1]:
timestamp app[web.1]: > passport-axios@1.0.0 start
timestamp app[web.1]: > node index.js
timestamp app[web.1]:
timestamp heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
timestamp heroku[web.1]: Stopping process with SIGKILL
timestamp heroku[web.1]: Process exited with status 137
timestamp heroku[web.1]: State changed from starting to crashed
timestamp heroku[web.1]: State changed from crashed to starting
timestamp heroku[web.1]: Starting process with command `npm start`
timestamp app[web.1]:
timestamp app[web.1]: > passport-axios@1.0.0 start
timestamp app[web.1]: > node index.js
timestamp app[web.1]:
timestamp heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=passport-llokup.herokuapp.com request_id=da8ab014-3902-4d67-9004-c744059279c2 fwd="116.203.217.173" dyno= connect= service= status=503 bytes= protocol=https
But no response in the browser. whereas it sends me the correct response in the localhost
require
is running code
const queryParam = (error, result) => {
if (error) throw error;
res.status(200).json(result);
};
exports.get_all_customers = (req, res) => {
const FETCH_CUSTOMERS = "SELECT * FROM Customers";
db.query(FETCH_CUSTOMERS, queryParam);
};
exports.get_customer = (req, res) => {
const GET_CUSTOMER_BY_ID = `SELECT * FROM Customers WHERE id = ${req.params.id}`;
db.query(GET_CUSTOMER_BY_ID, queryParam);
};
ReferenceError: res is not defined
res
into result