This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws UnknownHostException { | |
SpringApplication app = new SpringApplication(AngularspringbootmicrosservicoApp.class); | |
DefaultProfileUtil.addDefaultProfile(app); | |
Environment env = app.run(args).getEnvironment(); | |
String protocol = "http"; | |
if (env.getProperty("server.ssl.key-store") != null) { | |
protocol = "https"; | |
} | |
log.info("\n----------------------------------------------------------\n\t" + | |
"Application '{}' is running! Access URLs:\n\t" + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.get('/', async (req, res) => { | |
const users = await User.find(); | |
return res.send({ users }); | |
}); | |
router.post('/login', async (req, res, next) => { | |
const { name, password } = req.body; | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hello; | |
import java.util.concurrent.atomic.AtomicLong; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RequestParam; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class GreetingController { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Endpoint | |
public class CountryEndpoint { | |
private static final String NAMESPACE_URI = "http://spring.io/guides/gs-producing-web-service"; | |
private CountryRepository countryRepository; | |
@Autowired | |
public CountryEndpoint(CountryRepository countryRepository) { | |
this.countryRepository = countryRepository; | |
} |
OlderNewer