Skip to content

Instantly share code, notes, and snippets.

View bijay-shrestha's full-sized avatar
👨‍🎓
MSCS Compro

Bijay Shrestha bijay-shrestha

👨‍🎓
MSCS Compro
View GitHub Profile
@bijay-shrestha
bijay-shrestha / axios-catch-error.js
Created August 26, 2019 06:56 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
appName.dbOne.datasource.driverClassName=org.postgresql.Driver
appName.dbOne.datasource.url=jdbc:postgresql://localhost/dbOne
appName.dbOne.datasource.username=test
appName.dbOne.datasource.password=test
appName.dbTwo.datasource.driverClassName=org.postgresql.Driver
appName.dbTwo.datasource.url=jdbc:postgresql://localhost/dbTwo
appName.dbTwo.datasource.username=test
appName.dbTwo.datasource.password=test
@bijay-shrestha
bijay-shrestha / DatabasesConfig.java
Created July 1, 2019 06:49 — forked from mismatch/DatabasesConfig.java
Spring Boot. Multiple datasources configuration example
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;