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
from rest_framework import serializers | |
class EventSerializer(serializers.Serializer): | |
description = serializers.CharField(max_length=100) | |
start = serializers.DateTimeField() | |
finish = serializers.DateTimeField() | |
def validate(self, data): | |
""" | |
Check that start is before finish. |
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
const express = require('express'); | |
const app = express(); | |
const PORT = process.env.PORT || 3000; | |
const eurekaHelper = require('./eureka-helper'); | |
app.listen(PORT, () => { | |
console.log("user-service on 3000"); | |
}) | |
app.get('/', (req, res) => { |
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
const express = require('express'); | |
const app = express(); | |
const PORT = process.env.PORT || 3000; | |
const eurekaHelper = require('./eureka.helper'); | |
app.listen(PORT, () => { | |
console.log("user-service on 3000"); | |
}) | |
app.get('/', (req, res) => { |
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
const Eureka = require('eureka-js-client').Eureka; | |
const eurekaHost = (process.env.EUREKA_CLIENT_SERVICEURL_DEFAULTZONE || '127.0.0.1'); | |
const eurekaPort = 8761; | |
const hostName = (process.env.HOSTNAME || 'localhost') | |
const ipAddr = '172.0.0.1'; | |
exports.registerWithEureka = function(appName, PORT) { | |
const client = new Eureka({ | |
instance: { |